Cache expires not applying to some images in Wordpress
I defined cache expires for my Wordpress but SpeedTest still tells me I should fix it for some jpg and png images.
I have Cache Enabler plugin installed and added the following to my .htaccess:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</IfModule>
<IfModule mod_headers.c>
<filesMatch ".(ico|pdf|flv|jpg|svg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=84600, public"
</filesMatch>
<FilesMatch ".(css)$">
Header set Cache-Control "max-age=2692000, public"
</FilesMatch>
<FilesMatch ".(js)$">
Header set Cache-Control "max-age=216000, private"
</FilesMatch>
<FilesMatch ".(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
</FilesMatch>
Header unset ETag
Header unset Last-Modified
</IfModule>
I also tried to follow these instructions but still no luck.
Is there a particular reason why these images won't have their cache expiration defined?
All images are on my server by the way, most of them on the folders:
wp-content/uploads/cache/
wp-content/themes/Wordpress/images/
链接地址: http://www.djcxy.com/p/61214.html上一篇: 来自PHP的同步AMQP