Hi, yeah, i’ve got this working well with the litespeed cache now so that’s good. Was using the keycdn cache-enabler plugin and also simple-cache plugin and both stripped your headers.
As for the cache-control, if i have the following in htaccess is it correct that this instructs both the browser and the cdn how long to preserve the cache?
<filesMatch "\.(ico|jpg|jpeg|png|gif|webp|swf)$">
Header set Cache-Control "max-age=31536000"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "max-age=31536000"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=2592000"
</filesMatch>
<filesMatch "\.(woff|woff2|ttf|svg|eot|otf)$">
Header set Cache-Control "max-age=31536000"
</filesMatch>
In which case, is it necessary to also include expiresbytype directives in the htaccess as such? (This is just an example, the actual expiry values would normally match those of the cache control)
ExpiresActive On
ExpiresByType text/html "access plus 1 day"
ExpiresByType image/gif "access plus 1 years"
ExpiresByType image/jpeg "access plus 1 years"
ExpiresByType image/png "access plus 1 years"
ExpiresByType text/css "access plus 1 years"
ExpiresByType text/javascript "access plus 1 years"
ExpiresByType application/x-javascript "access plus 1 years"
ExpiresByType application/javascript "access plus 1 years"
I removed the expiresbytype and just kept the cache control and pagespeed didn’t give me any warning about browser caching.
Is there any reason to keep both expiresbytype and cache-control? Or do you recommend just using cache-control?