[Plugin: WP Super Cache] – adding max-age for images/css
-
Hi,
I use the mod-rewrite option in WP Super Cache, it seems to work.
As the plugin does not add expiry dates or max-age for images or css, I modified the .htaccess file in the cache folder (wp-content/cache/) manually and added max-ages for images and css. (I cannot use the expiry module with my virtual server, so I cannot add expiry dates.)
I added the following code to the .htaccess file in the cache folder:
# BEGIN Cache-Control Headers <ifmodule mod_headers.c> <filesmatch "\.(flv|gif|jpg|jpeg|png|ico|swf)$"> Header set Cache-Control "max-age=86400" </filesmatch> <filesmatch "\.(css|pdf)$"> Header set Cache-Control "max-age=86400" </filesmatch> <filesmatch "\.(js)$"> Header set Cache-Control "max-age=86400, private" </filesmatch> </ifmodule>
The whole file now looks like this:
http://pastebin.com/B4WGnTjMBut when I check the browser caching of static assets, I still get the message: No max-age or expires for the images and the css file.
Can anyone please help?
Many thanks in advance.
- The topic ‘[Plugin: WP Super Cache] – adding max-age for images/css’ is closed to new replies.