Having added ES/EB/K and Kunena to my J2.5 site it was bogging down so I spent some time with YSlow and Google page tools to try to eradicate all bottle necks. I ended up doing the following (and achieving a worthwhile reduction in page load times)
These are my htaccess additions.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 2 years"
ExpiresByType image/jpeg "access plus 2 years"
ExpiresByType image/png "access plus 2 years"
ExpiresByType text/css "access plus 2 years"
ExpiresByType text/javascript "access plus 2 years"
ExpiresByType application/x-javascript "access plus 2 years"
ExpiresByType image/ico "access plus 2 years"
</IfModule>
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE image/x-icon image/svg+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE font/opentype
</IfModule>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
I also added
JCH Optimize plugin . That needs some fine tuning to make sure everything still works and you're not competing with existing compression option in Joomla and components but it was certainly worthwhile and I went through quite a few iterations.
GZIP was the interesting one. Switching in on in the global config
did not actually enable it. I had to add the deflate statements in the htaccess to make it work.
I am no htaccess expert - I got these from scouring various articles on fixing the errors hightlighed by YSlow.