PHP
EN
A quick WordPress Super Cache fix
[]
phpied.com
When you use a bog-standard WordPress install, the caching header in the HTML response isCache-Control: max-age=600OK, cool, this means cache the HTML for 10 minutes.
However, I noticed it ads another header:Cache-Control: max-age=3, must-revalidateAnd actually now there are two cache-control headers being sent, the new and the old:Cache-Control: max-age=3, must-revalidate Cache-Control: max-age=600What do you think happens?
A config fixThen I had to poke around the code and saw this:// Default headers.
$headers = array( 'Vary' => 'Accept-Encoding, Cookie', 'Cache-Control' => 'max-age=3, must-revalidate', ); // Allow users to override Cache-control header with WPSC_CACHE_CONTROL_HEADER if ( defined( 'WPSC_CACHE_CONTROL_HEADER' ) && !
So the page is loaded completely from the browser cache.
['default'
'seconds'
'headers'
'quick'
'wordpress'
'fix'
'cache'
'header'
'browser'
'cached'
'wpsc_cache_control_header'
'super'
'html'
'cachecontrol']