How to change thumbnails cache policy?
-
Hi Frank,
I’ve just found a new error on PageSpeed Insights. It’s about a cache lifetime of thumbnails stored locally. It appears to be set to 7 days. I would like to change this value to at least 30 days, although I don’t know if it doesn’t have to be set to 6 months for this error to disappear.
I found this code in lyteCache.php, but I don’t know how to modify it. Is it enough to change “7” to any value? Could you help? ??
// send all sorts of headers
if ( ! defined( 'LYTE_CACHE_EXPIRE_TIME' ) ) {
$expireTime = 60 * 60 * 24 * 7; // 1w
} else {
$expireTime = LYTE_CACHE_EXPIRE_TIME;
}
header( 'Content-Length: '. strlen( $thumbContents) );
header( 'Cache-Control: max-age=' . $expireTime . ', public, immutable' );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expireTime ).' GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', $modTime ) . ' GMT' );
header( 'Content-Type: ' . $contentType );
echo $thumbContents;Best,
Adrian
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.