Question

I'm currently developing a website that's getting fairly frequent javascript updates and have just started using mod_pagespeed in an effort to ensure that customers will always have the latest code.

The docs tell me doing this will clear my pagespeed cache and force clients to get my new javascript/css:

sudo touch /var/cache/pagespeed/cache.flush

I did a test by changing some javascript code, hitting refresh on my browser to verify that I was still seeing the old code (my cache expiration is set to one day), then restarting apache, and I can indeed see my new changes.

Can I trust that a restart will always be sufficient, and that a cache.flush is not needed, or do I need to run the flush command as well? I'm reading that a restart of apache is required to clear the memory cache, but not how the file cache and/or cache.flush fits in with that.

Update:

I pulled the pagespeed code, and if I'm understanding correctly, the cache.flush process updates a timestamp.

It looks like that's happening in RewriteOptions::UpdateCacheInvalidationTimestampMs here: http://modpagespeed.googlecode.com/svn/trunk/src/net/instaweb/rewriter/rewrite_options.cc

If I could figure out which timestamp this was updating, it seems like I could either check it/restart apache/check it again (to see if the timestamp changed) or deduce from the filename/location/who owns it somehow whether or not that's likely to happen.

Any more thoughts on this? Advice on how to figure out which timestamp is being updated? Other reasoning to make me feel better about either manually doing the extra flush command every time I update (when I'm already restarting apache for other reasons) or leaving it out?

Était-ce utile?

La solution 2

No restart of Apache doesnt clear the pagespeed cache. You have to do it manually by using cache.flush.

Autres conseils

touch the cache.flush file:

sudo touch /var/cache/mod_pagespeed/cache.flush

Reference: https://developers.google.com/speed/pagespeed/module/system#flush_cache

What I like to do to ensure that the whole cache on the entire web portion of the server

Apache2, this is a dry run, remove "-D" if you are sure you want to go through with it -l is for size of memory -p for path:

htcacheclean -D -p/var/cache/apache2 -l100M

mod_pagespeed:

sudo touch /var/cache/mod_pagespeed/cache.flush

A restart of Apache should flush the cache.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top