springuser2014 / wro4j

Automatically exported from code.google.com/p/wro4j
0 stars 0 forks source link

Caching should be disabled in DEVELOPMENT mode #133

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It seems the caching is enabled in DEVELOPMENT mode. It shouldn't be according 
to wiki.

I use 1.3.0-rc1 and following configuration:

<filter>
    <filter-name>WebResourceOptimizer</filter-name>
    <filter-class>ro.isdc.wro.http.WroFilter</filter-class>
    <init-param>
      <param-name>configuration</param-name>
      <param-value>DEVELOPMENT</param-value>
    </init-param>
    <init-param>
      <param-name>managerFactoryClassName</param-name>
      <param-value>ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory</param-value>
    </init-param>
    <init-param>
      <param-name>uriLocators</param-name>
      <param-value>servletContext,classpath,url</param-value>
    </init-param>
    <init-param>
      <param-name>preProcessors</param-name>
      <param-value>bomStripper,cssUrlRewriting,cssImport,semicolonAppender</param-value>
    </init-param>
    <init-param>
      <param-name>postProcessors</param-name>
      <param-value>cssVariables,cssMinJawr,jsMin</param-value>
    </init-param>
    <init-param>
      <param-name>gzipResources</param-name>
      <param-value>FALSE</param-value>
    </init-param>
    <init-param>
      <param-name>cacheUpdatePeriod</param-name>
      <param-value>600</param-value>
    </init-param>
    <init-param>
      <param-name>modelUpdatePeriod</param-name>
      <param-value>600</param-value>
    </init-param>
</filter>

Original issue reported on code.google.com by vlad.har...@gmail.com on 26 Oct 2010 at 3:31

GoogleCodeExporter commented 9 years ago
Hi Vlad, if you want we can continue to discuss on the mailing list.

Regarding your observation, you are right. But this is intended behavior, 
probably the documentation on wiki is outdated. Previous versions of wro4j 
(mainly before 1.1.x branch) didn't cache in DEVELOPMENT mode, but it was 
changed later. The reason is speed: sometimes the processing takes too much and 
is annoying even if you are working in DEVELOPMENT mode. That is why caching 
works no matter what is the configuration mode. 

However, there is at least one alternative:
- Change cacheUpdatePeriod and/or modelUpdatePeriod parameters to something 
close to 1 (seconds), thus the cache and/or the model will be updated very 
often by a background thread. This approach improves greatly the impact on time 
spent on debugging web application.

I'll close this issue with "WON'T FIX" status. If you have different thoughts 
or opinion, we can continue the discussion on the mailing list.

Regards, 
Alex

Original comment by alex.obj...@gmail.com on 26 Oct 2010 at 6:58

GoogleCodeExporter commented 9 years ago
One more thing about differences between those two modes:
The only differences by now are the following:

a) In DEVELOPMENT - you can add "?minimize=false" in request url in
order to turn off minimization on static resources, while in DEPLOYMENT you 
can't.

b) In DEVELOPMENT mode any runtime exception is logged and thrown
further, while in DEPLOYMENT it is logged and the response is redirected to 404.

Original comment by alex.obj...@gmail.com on 26 Oct 2010 at 7:05

GoogleCodeExporter commented 9 years ago
OK, I understand your tendency to keep configuration simple and unambiguous. To 
implement my own caching strategy is another possible option. From my point of 
view no further discussion is needed.

Regards,
Vladimir

Original comment by vlad.har...@gmail.com on 27 Oct 2010 at 7:18