Mod_pagespeed delete cache? Mod_pagespeed delete cache? wordpress wordpress

Mod_pagespeed delete cache?


Google's PageSpeed docs on Legacy Flushing Of Entire Cache suggests this:

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


From: https://developers.google.com/speed/docs/mod_pagespeed/faq#ignores-changes

There are two distinct cache-times at play when you use mod_pagespeed:

The origin TTL which mod_pagespeed uses to refresh its internal server-side cache.

The TTL with which mod_pagespeed serves rewritten resources to browsers. When mod_pagespeed first reads your reousrce file, it uses the origin TTL to figure out how often to re-examine the origin CSS file. Assume your origin TTL is 1 day. Once mod_pagespeed has that file in cache, it will not go back & re-check that file for a day. Changing the TTL after mod_pagespeed has put the resource in its cache will not help because mod_pagespeed is not going to reload the resource until the one in its cache expires, or you clear its cache.

We recommend an origin TTL of 10 minutes, which provides reasonable responsiveness when you update a file. If you try to make it much smaller, then your server will need to refresh it more frequently. This adds server load and reduces optimization.

To see changes to your files more quickly while developing, flush the cache on your server(s).

If your environment allows you to enable ModPagespeedLoadFromFile, you can get the best of both worlds because mod_pagespeed can eliminate its internal server-side cache.


Flushing the cache of a specific page in Pagespeed requires that the server support cache purging. In Apache, this means ModPagespeedEnableCachePurge on in the site's configuration. In Nginx, you'll need pagespeed EnableCachePurge on; instead. This setting allows you to send a specially-crafted HTTP request to force-purge a specific page in Pagespeed. For example with cURL:

curl 'http://example.com/pagespeed_admin/cache?purge=path/file.ext'

There is also another method for purging single pages in the cache (curl --request PURGE 'http://www.example.com/path/file.ext'), however this requires an extra, optional config option in your site's config file (ModPagespeedPurgeMethod PURGE for Apache and pagespeed PurgeMethod PURGE; for Nginx).

For more information, please refer to the documentation describing this process for more detail.