Jack
Jack

Reputation: 683

Gzipped CSS/JS/HTML

I've heard about this recently, and I have a few questions:

  1. Does any browser support this?
  2. What happens if a browser doesn't support it, are they left unloaded?
  3. Can I use this feature on a shared hosting using Apache and PHP5?
  4. How can I use this feature?

P.S. It'd be related to Wordpress, if that matters.

Upvotes: 1

Views: 139

Answers (1)

techfoobar
techfoobar

Reputation: 66663

  1. Browsers send a Accept-Encoding request header which will make it clear to the server whether compression is supported. Good news is almost all popular browsers support it

  2. Server responds to the request based on if the browser supports gzip (i.e. if the Accept-Encoding request header contains gzip in it). If it is supported, the server responds with gzipped content - indicated by the Content-Encoding response header.

  3. Check this for how you can configure output compression on Apache HTTPD - Note you'll need to be able to edit the config file, which you may not be, since you are on a shared hosting server.

  4. Configuring mod_deflate on Apache is all you need to do to start using this feature. It will take care of checking the Accept-Encoding request header and responding accordingly. Make sure you do not force compression by using force-gzip - You can find details regarding this on the link above.

Upvotes: 3

Related Questions