Can someone provide me with an optimized .htaccess configuration that handles compression, browser caching, proxy caching, etc. for a typical website?
Aside from my visitors, I'm also trying to make Google PageSpeed happy. I wanna use caching and gzip compression through .htaccess please help me with its code!
I want to cache icon,pdf,flv,jpg,png,gif,js,css,swf
files for long time
I want to cache xml,txt
files for 2 Days
I want to cache html
files for 2 Days
And I wanna compress my html,txt,css,js,php
files because those have large file size.
Is there any way to gzip images using .htaccess?
gzip
is not of much interest, as GIF, JPEG or PNG are already compressed formats. Compressing them would just be a loss of CPU ressource on your server, without any gain in bandwidth. – Mathieu Rodic