Max-age query
-
I have recently moved over to WP Super Cache from W3TC and I have a query about caching using this plugin.
I have a VPS running Apache, Varnish and PHP 5.5 FPM.
The default max-age when using WP Super Cache is 3, which is definitely way too short a time, especially as after 3 seconds, Varnish no longer caches the page and then results in a Miss when the page is visited again. Therefore in wp-cache-phase1.php, I have changed this to 3600 (1 hour) to help Varnish do its work properly.
However, when making a change to the website, either page, post, widget or other, it still shows the old version. I understand that in theory I’d have to wait for the hour to end before the new page is shown as the old version will remain in the cache. But, is there not a way for the new updated page(s) to be shown instead of the cached version?
I’ve not had this issue with W3TC and I am only moving away from that plugin due to the lack of support, especially with the new version of WP throwing errors when updating a page.
Any advise would be great; here are my headers:
Request:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding:gzip, deflate, sdch Accept-Language:en-US,en;q=0.8 Cache-Control:max-age=0 Connection:keep-alive Cookie: *removed* Host: *removed* If-Modified-Since:Tue, 02 Feb 2016 13:07:31 GMT Referer:https://www.google.co.uk/ Upgrade-Insecure-Requests:1 User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36Response:
Accept-Ranges:bytes Age:20 Cache-Control:max-age=3600, must-revalidate Connection:keep-alive Content-Encoding:gzip Content-Type:text/html; charset=UTF-8 Date:Tue, 02 Feb 2016 13:08:29 GMT Expires:Tue, 02 Feb 2016 13:08:32 GMT Last-Modified:Tue, 02 Feb 2016 13:07:31 GMT Server:Apache Vary:Accept-Encoding,Cookie Via:1.1 varnish X-Cache:HIT X-Varnish:1571561973 1571561930I’d rather keep the page in the cache for a while as the sites hosted aren’t updated often, however, I’d like it to update changes when they’re made.
I am also using the Varnish HTTP purge plugin as well as purging from SSH to see if this would help but to no avail.
I guess keeping the max-age at 3 would work as it’s not cached for long but some sites aren’t updated for weeks/months and so i’d like those ones to be cached for longer as Varnish will work better for avoiding so many misses.
Any advise would be greatly appreciated, hopefully I’ve explained myself properly!
Thanks
The topic ‘Max-age query’ is closed to new replies.