Posts

Showing posts with the label gzip

optimize gzip and leverage browser cache through .htaccess

Recently i was working on YII2 project i used to several gzip code in yii2 to optimize by validating the site through page speed from google.I was able to come out with solution through youtube and taken the code from comment session and added in my .htaccess file.Let me share the code below <IfModule mod_headers.c> <FilesMatch "\.(js|css|xml|gz)$"> Header append Vary: Accept-Encoding </FilesMatch> </IfModule> # Deflate Compression by FileType <IfModule mod_deflate.c>  AddOutputFilterByType DEFLATE text/plain  AddOutputFilterByType DEFLATE text/html  AddOutputFilterByType DEFLATE text/xml  AddOutputFilterByType DEFLATE text/css  AddOutputFilterByType DEFLATE text/javascript  AddOutputFilterByType DEFLATE application/xml  AddOutputFilterByType DEFLATE application/xhtml+xml  AddOutputFilterByType DEFLATE application/rss+xml  AddOutputFilterByType DEFLATE application/atom_xml  AddOutputFilterByType DEFLATE a...