Viewing Posts in Quick Tips

Using Apache to Compress HTML,CSS & Javascript

8th September 2010 General Quick Tips Webserver

Just a quick tip that I've come across recently, add this to your .htaccess file and if your server supports gzip compression HTML, CSS and Javascript will be automatically compressed.

# compress types
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

Not sure if the browser uses a cached version on subsequent requests so this technique may not be suitable for everything.

0 comments

Back to Home Page

Sites I've Created

DSP Chartered Surveyors Stoneylane Aberdeen Angus

Recently Watched Films

Mr Brooks Rec Pathology Diary of the Dead

TV Shows

The Shield Flight of the Conchords

Hosting

I've been using Dreamhost for my hosting for over 2 years and it's pretty good for what you pay. If you're signing up how about showing me some love and use this link so I get a referal bonus to help pay my server costs.

Site by James Fairhurst © 2008-2012, all rights reserved and all that malarky