PDA

View Full Version : .htaccess Expires Headers and zlib Compression



conor
June 3rd, 2009, 09:37 PM
I wanted to share another tidbit with the wider audience about adding Expires headers and zlip compression to your .htaccess files.



php_flag zlib.output_compression on
php_value zlib.output_compression_level 5

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
Header unset ETag
FileETag None
</FilesMatch>


If you use YSlow to analyze your web pages then these will help achieve a better rating. Even if you don't use YSlow these will help speed up your web pages.

WebVeteran
September 13th, 2009, 07:24 AM
Normally compressed file formats don't lose more weight by re-compressing them. FLV being one of them (along with MP3, MPGs, JPG, etc) though I have not tested re-compressing a FLV. Have you found good savings by compressing them with zlib?