We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Compress your website for mobile | Forum

Pete
Pete Aug 28 '13

If you or planning to run your site on mobile you might be wise to compress your site

 you should gzip(compress your mobile site) as it will take to long on 3G networks, and could time out.

Here is the code to compress it, just put the following in your htaccess file.

 

 

# compress text, HTML,php, JavaScript, CSS, and XML
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/php
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
# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

Christer
Christer Aug 29 '13
Hey Pete
Nice to share, thanks.
Josh
Josh Sep 1 '13
Thanks pete, does his have another of effects on my website?
Pete
Pete Sep 1 '13

Ye it will compress everything to make things load faster on a mobile also make things smaller for mobile