About This Site {Me}
I spend a lot of time building websites, writing code, getting excited about things on the interwebs, pushing pixels around a screen and generally being a bit geeky. I also try to be cool and do other things like spend time with my girlfriend, kitesurf and take photos of things.
Image and resource caching with htaccess
Wednesday 23rd March '11
This is as much a bookmark for myself as anything. I just discovered this .htaccess trick to easily set resource caching with apache. It requires mod_headers enabled which comes compiled by default but switched off. Then all you need do is add something like this to your .htaccess file:
<IfModule mod_headers.c> <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf)$"> Header set Cache-Control "max-age=2592000" </FilesMatch> </IfModule>
Which will cache images and flash for one month. The link posted above has loads more info.







