Reputation: 15241
I'm targetting a couple of web projects at mobile users, and noticed that some of the standard tools (JS libraries, json transfers, xml etc) are quite heavy for mobile data plans.
I'd like to be able to implement gzip'd resources, and probably mod_deflate/mod_gzip to try and reduce the amount of bandwidth used by these devices.
However, I don't know how widespread support for gzipped javascript, gzipped html etc. is on mobile devices, or even if it is common practice to use...? It seems to make sense though.
Is it ok to use as a solid tool for the common mobile devices..? iPhone, android, blackberry, windows mobile/opera..?
Thanks.
Upvotes: 7
Views: 5531
Reputation: 50109
As far as I know most of them supports it, but if you configure you're server well it will be able to send non-compressed resources if needed.
Another benefit is that you improve caching as some devices like iPhone has limits of 25k for a content to be cached.
So the short answer is: Just Do It
Upvotes: 3
Reputation: 92762
Go for it - the gzipped version should be only sent if a browser sends an Accept-Encoding: gzip
(and the modules check for this automatically). (see the relevant part of RFC 2616)
(the usual warning applies - some browsers are broken. For example, IE6 advertises gzip-capability but doesn't actually support it properly. For mobile browsers, I haven't encountered such brokenness yet - so far every mobile browser that advertised gzip supported it)
Upvotes: 2
Reputation: 449465
mod_deflate
/ mod_gzip
will check the client's "accept" headers and turn compression on or off accordingly.
Just turn it on in your server, and make sure your js
and css
resources get compressed as well. You can use Firebug's "Net" tab to check whether compression was applied to the loaded resources.
If compression is mising for certain file types, check out this question for how to turn it on.
Upvotes: 2
Reputation: 13804
I don't think it matters, a browser will request GZipped data if it supports it, so your server will only GZip it if your browsers asks it to.
Upvotes: 7