How to clear wro4j cache in a site deployed to the AppEngine?

365 views
Skip to first unread message

Fipil

unread,
May 5, 2016, 8:36:02 AM5/5/16
to wro4j
Hi,
I've a site deployed to the Google AppEngine. The site uses wro4j.
Problem is that I cannot flush the cache of the wro generated files. I still have the old ones, for example old wro/main.css generated file, even if I redeployed an application with a new source css files.

I tried to kill and restart the AppEngine instances without success. Of course I also cleared my browser's cache, but still no success.
Only way I found is to deploy my application as a completely new version to GAE.

I found the description of the /wro/wroAPI/reloadCache , but it's available only in DEVELOPMENT mode.

Please, how can I clear wro4j cache on the deployed site??

Here is my wro.properties file:
managerFactoryClassName=ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory
preProcessors=cssMinJawr,semicolonAppender,dojoShrinksafe
postProcessors=jsMin
cacheUpdatePeriod=0
modelUpdatePeriod=0
debug=false
minimizeEnabled=true
disableCache=false
gzipResources=true
ignoreMissingResources=false
resourceWatcherUpdatePeriod=0
jmxEnabled=false

Thank you.
Filip

Alex Objelean

unread,
May 10, 2016, 10:25:41 AM5/10/16
to wr...@googlegroups.com
Hi Filip, 

sorry for late reply.

The bundles generated by wro4j are not stored as files, rather you can see them as virtual resources stored in memory being served by endpoint corresponding for each group. Every time the application is started, the virtual resource is computed lazily (after the first request) and stored in memory for serving subsequent requests. 

The reloadCache endpoint is useful in development, because the css & js resources are changed frequently and virtual resource needs to be generated from scratch after a resource has changed. It very unlikely that you tweak your resources in production without restarting it, therefore the reloadCache endpoint is not exposed for production (however it is possible to configure the endpoint to work for non debug mode as well).

I suspect that the real reason of why you see the old resource even after restarting the application is the caching headers. This is something you can configure (by using far expiry date). The best practice is to use aggressive caching by combining far expiry date with generating unique url (which encodes the version number of the bundled resources in its path). 

I don't really see the difference between restarting the AppEngine and deploying a completely new version of GAE. This shouldn't really matter if the app is deployed with GAE or somehow else.  

Let me know if that helps or if you have more details which would help to understand the problem.

Thanks,
Alex Objelean


--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
To post to this group, send email to wr...@googlegroups.com.
Visit this group at https://groups.google.com/group/wro4j.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages