3

Per my request, my webhost had turned mod_deflate ON.

In my Cpanel I now have an "Optimize Website" button.

Inside that menu I could either choose:

"Compress all content" or "Compress the specified MIME types" with the following default MIME types: "text/html text/plain text/xml"

  1. Which option should I choose and why?

  2. If I choose option 2, which types should I add (is there a recommended list with the exact way they should be written)?

  3. According to Google recommendations, I have omitted the type="text/css" attributes from all CSS references, as well as the type="text/javascript" attributes from all script references. Would this hinder the "gzipping" process?

3

Which option should I choose and why?

I would probably choose the second option, but add to that list text/css and text/javascript.

Basically you want to compress any text-based content, but not content like images, as these are already compressed.

I have omitted the type="text/css" attributes from all CSS references, as well as the type="text/javascript" attributes from all script references. Would this hinder the "gzipping" process?

That looks like Google's internal style guide, it's not meant for your website. However I wouldn't expect any issues from omitting mime types in that way. They're not required in HTML5.

3
  • Thanks, though In addition to the text/html text/plain text/xml and the text/javascript text/css you suggested, I've also added application/x-javascript application/javascript application/xhtml+xml, as without this, .js file would not be compressed (saw the size difference on my server log). I just wonder whether this is now enough, and what could be a possible drawback of simply choosing "compress all"? – rockyraw Apr 2 '14 at 11:57
  • Well, it depends a bit on whether 'compress all' means literally that. But like I said, you don't want to compress things like images, as they are already compressed. So you waste server resources by doing so. – Tim Fountain Apr 2 '14 at 12:41
  • 1
    @rockyraw The server does the gzipping but won't inspect your HTML attributes so, no, removing the 'type' attributes won't affect gzipping but, as stated, HTML5 doesn't require it and browsers have used the default for years. – Rob Jul 31 '14 at 17:38
0

I'm testing this out myself, but I found helpful links. In trying this I have had no errors yet. Interestingly it did appear to compress the MIME types text/html text/plain text/xml text/css text/javascript application/javascript

If you use cpanel:

https://documentation.cpanel.net/display/68Docs/Optimize+Website

There is a suggestion for MIME Types to try for the"specific types" configuration:

http://httpd.apache.org/docs/2.4/mod/mod_deflate.html

But it did nothing for my performance. So.. Further testing needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.