Back htaccess

Add Gzip compression using htaccess

WRITTEN BY ON 15 Dec 2010
20,693 VIEWS • SHARES
2 comments

Optimize your website loading time by compressing files into smaller size.

Apache

Put this in your directory htaccess file.

# compress text, html, javascript, css, xml:
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

Join the discussion

Comments will be moderated and rel="nofollow" will be added to all links. You can wrap your coding with [code][/code] to make use of built-in syntax highlighter.

2 comments
Kevin 13 years ago
Testing 123
Reply
Akshay 13 years ago
Hey, is this possible even for swf objects or video files??
Reply