Speed up your Mobile Site ™


I run a Norwegian quiz site for mobile phones called MobilQuiz. This service is a simple Trivial Persuit-like Quiz where you are presented a question on your mobile screen with a simple link to the answer. Really simple and fool prof.

I have during the last weeks upgraded this service to also consist of a iPhone-ified version. And since the iPhone functions require some hefty CSS and Javascript-libraries, bandwidth-optimalization comes handy.

Mod_deflate

I proxy my Rails-application through Apache2 and that’s where this gzip-compression-trick called mod_deflate applies. You have to compile your Apache2-installation with --enable-deflate. When that is done, you could just insert this snippet inside your virtual domain space in httpd.conf.

<Location />
  SetOutputFilter DEFLATE
  SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$  \
		no-gzip dont-vary
  SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
  SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ \
    no-gzip dont-vary
</Location>

Result in bandwidth usage

Before applying mod_deflate the front page on MobilQuiz clocked in on 33 KB

After applying mod_deflate the front page only weights 17 KB

That’s a 48,5% reduction. Not bad, huh?

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

[...] – bookmarked by 4 members originally found by mikkorantalainen on 2008-07-23 Speed up your Mobile Site ™ http://webdirect.no/web/speed-up-your-mobile-site-tm/ – bookmarked by 2 members originally found [...]