Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Image resource 'expiration'
I browsed my site with ‘Page Speed’ and got some interesting results to improve my page load performance.
On in particular I thought Textpattern might handle for me, but apparently not.
Page Speed report on my images that:
“The following resources are missing a cache expiration. Resources that do not specify an expiration may not be cached by browsers. Specify an expiration at least one month in the future for resources that should be cached, and an expiration in the past for resources that should not be cached:”
How can I force textpattern to return an expiration date for my images to improve browser caching?
Offline
Re: Image resource 'expiration'
In retrospect I realize the issue is that Textpattern isn’t actually serving the images, with the URLs generated they are directly being served by the web server and bypassing Textpattern.
However, the question still stands… is there any way to force an expires header with Apache (.htaccess or otherwise) to improve caching?
Should I even worry about this?
Offline
Re: Image resource 'expiration'
Wonder about exactly the same issue, mericson, and i am looking for the answers too.
Smile, Breath, Go slowly – Thich Nhat Hanh
Offline
Re: Image resource 'expiration'
I handle this in my .htaccess file— the exact configurations will vary from server to server and from site to site, but here are the rules I use for one site:
# Expiry
# .............................................
FileETag None
<IfModule mod_expires.c>
ExpiresActive On
#ExpiresDefault A600
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/gif "access plus 1 day"
ExpiresByType image/png "access plus 1 day"
ExpiresByType image/jpeg "access plus 1 day"
#ExpiresByType text/plain "access plus 1 year"
ExpiresByType application/x-shockwave-flash A2592000
ExpiresByType video/x-flv A2592000
ExpiresByType application/pdf A2592000
#ExpiresByType text/html A600
</IfModule>
Offline
Re: Image resource 'expiration'
wow, johnstephens that works fine with my server. Thank you very much.
Smile, Breath, Go slowly – Thich Nhat Hanh
Offline
Pages: 1