Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have shared hosting through Justhost. I use the HTML5 Boilerplate .htaccess (have tried other methods from here and there without luck) the compression part is as follows:

<IfModule mod_deflate.c>

  # Force deflate for mangled headers
  <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
      SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
      RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding

  # Compress all output labeled with one of the following MIME-types
  <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE application/atom+xml \
                                  application/javascript \
                                  application/json \
                                  application/rss+xml \
                                  application/ \
                                  application/x-font-ttf \
                                  application/xhtml+xml \
                                  application/xml \
                                  font/opentype \
                                  image/svg+xml \
                                  image/x-icon \
                                  text/css \
                                  text/html \
                                  text/plain \
                                  text/x-component \


However, it isn't working—at least I don't think—My home page (html) isn't compressing, the CSS and some of the JS aren't gzipped.

It is failing on HTML, CSS and JS.

However, some things are (or were, who knows what it will look like when you check) gzipped.

My domain is

What is weird is that the (Google) PageSpeed browser extension for Firefox (whatever the current version is [Nov. 2012]) gives me a 95% speed rating (and no warnings about compression), yet YSlow and Chrome developer tools both flag me about gzip, as does a tool I found on here while researching this.

To reduce cookies I set up a subdomain on my site and I thought maybe that was it so I added an .htaccess there also, but no luck.

To reduce http requests I embedded some of webfonts and images in CSS (HTML5 BP stipulates not to compress images, and apparently '.woff' files are already compressed) so I thought maybe that was it and I spent all day separating and asynchronously loading those portions (via Modernizr.load) but that hasn't helped either...if anything it made it worse due to increasing http requests (I realize speed scores of async resources may be misleading).

Researching this, it seems to be a fairly common issue but I haven't found an explanation/solution.

I don't think it is a MIME-type issue, I have quadruple checked (and thrice edited) my .htaccess files.

My hosting company said they run Apache 2.2.22 and I have looked at everything I can find.

What gives?

share|improve this question
"I use the HTML5 Boilerplate .htaccess". No, you don't. There is no connection between HTML (any version) and .htaccess. One tells the browser how to render the page. The other provides web server directives. – John Gardeniers Nov 12 '12 at 5:36
I meant that because this is new to me and unfamiliar I use the .htaccess file that is included in HTML5 Boilerplate downloads, the current version of which is here: – adam-asdf Nov 13 '12 at 10:31

1 Answer 1

up vote 3 down vote accepted
  1. Mod_Deflate is a module that CAN be loaded, it is not a part of Apache in any version.
  2. .htaccess files MAY contain "override" directives. Which ones can be administratively controlled in Apache's main configuration files, they can even configure Apache to use a different file name. Just because you put something in an .htaccess file doesn't mean Apache can or will do anything with it.

You'll have to contact your host to determine if and how to configure compression.

share|improve this answer
I'll get on that now, thanks. – adam-asdf Nov 12 '12 at 3:52
Sorry, that probably came across a bit harsh, I didn't intend it that way. I just wanted to stress that when you're using hosting like this the various options are highly controlled by the host, and not the customer. If you want to be able to have a high degree of control you'd have to run Apache yourself, a VPS, Dedicated Server, or your own Hardware. – Chris S Nov 12 '12 at 4:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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