Is there a way to configure wro4j to collect modified files without restarting during development?

I am using Embedded Jetty, has maxCachedFiles = 0 and useFileMappedBuffer = false, so on a Windows machine it picks up changes to the template file and js / css changes.

Now that we have started using wro4j, we are losing this convenient hot deployment feature.

Is there a way to configure wro4j to collect modified files without restarting during development?

+4
source share
1 answer

There are several configuration properties that you can use to achieve this:

# explicitly invalidates the cache each 5 seconds cacheUpdatePeriod=5 # check for changes each 5 seconds and invalidates the cache only when a change is detected resourceWatcherUpdatePeriod=5 

"resourceWatcherUpdatePeriod" seems to be broken in 1.7.0, but will be fixed in a future version. You can also explicitly invalidate the cache using the http endpoint (aka request handler), available only in design mode:

 /wro/wroAPI/reloadCache 

or through JMX. More information about request handlers can be found here: https://code.google.com/p/wro4j/wiki/RequestHandler

+3
source

Source: https://habr.com/ru/post/1494159/


All Articles