Reading the plugin FAQ:
http://wordpress.org/extend/plugins/wp-super-cache/installation/
After you have enabled the plugin, look for the file “wp-content/cache/.htaccess”. If it’s not there you must create it. It should read:
# BEGIN supercache <IfModule mod_mime.c> <FilesMatch ".html.gz$"> ForceType text/html FileETag None </FilesMatch> AddEncoding gzip .gz AddType text/html .gz </IfModule> <IfModule mod_deflate.c> SetEnvIfNoCase Request_URI .gz$ no-gzip </IfModule> <IfModule mod_headers.c> Header set Cache-Control 'max-age=3, must-revalidate' </IfModule> <IfModule mod_expires.c> ExpiresActive On ExpiresByType text/html A3 </IfModule> `` # END supercache
The Question is why
Header set Cache-Control ‘max-age=3, must-revalidate’
must be 3 seconds?
Shouldn’t this be much higher? Can i change this value to let’s say 604800 ?
This is my own scenario:
- I dont allow comments
- I don’t have dynamic widgets
- I post every day but i don’t bother if my content is shown a few hours after
- I run an XML import every week – adding about 500 posts in one hour
Quote: Most users will not even notice the cache validation requests, but delivering outdated cache files is much more visible. – I am doing this more for SEO purposes – please look at: http://seobyg.com/http-header/cache-control
i think it does matter for SEO to have a high max-age – right ?
The best value depends on the dynamic content you have:
I think, the recommended value is the one that avoid too much support questions. Most users will not even notice the cache validation requests, but delivering outdated cache files is much more visible.
You should run some experiments and increase the
max-age
value in small steps until you note side effects. Start with 30 seconds, then double the value each week. I don’t think there are important SEO effects. Other factors are much more important.For a project a long time ago I developed a dynamic value:
But you cannot do that in a .htaccess file, because the server doesn’t know when a post was last modified in the database.
Just to be clear: this max-age refers to the external caching – that is, to how long the page is cached in the BROWSER. You don’t want the browser to cache pages for a lengthy time. If you fix as much as a typo in a post, that page will still show the error because it comes from the browser’s cache.
The max-age is NOT how long WP Super Cache caches the page. That can be set based on your garbage collection – or even indefinitely (i.e., as long as the post was not edited). If you have no dynamic content on the page, then by all means set WP Super Cache time to a lengthy one. But you don’t want the BROWSER to cache it for a lengthy time (as opposed to really static assets, such as js, css, images, etc – that should be cached by the browser for a day or a week or even a month, because they normally seldom change).