0

I'm using mod_deflate to server gzip content for js and css files.

Using curl I can see that it works and I can see the code but Chrome still thinks it's gzip content and NOT stylesheets/javascript so it won't render them.

Chrome says: Resource interpreted as Stylesheet but transferred with MIME type application/x-gzip.

So I guess that's apache sending wrong headers. But I don't know how to fix it.

Anyone has an idea?

Server is running Ubuntu 12 64 bits, with apache2.

Thanks!

5
  • What were the response headers? May 17, 2013 at 2:02
  • @MichaelHampton it was: Content-Encoding: gzip Content-Length: 21139 Content-Type: application/x-gzip
    – Tommy B.
    May 17, 2013 at 2:23
  • Your Content-Type is definitely wrong. How did you set this up? May 17, 2013 at 2:43
  • I now switched to nginx, and same error that's weird. Not the same setup at all with gzip options turned on... I'm still searching
    – Tommy B.
    May 17, 2013 at 2:50
  • 1
    You can check it out here thanks! 54.245.109.20
    – Tommy B.
    May 17, 2013 at 2:52

1 Answer 1

1

Your links are wrong.

You've made links to file.css.gz, which just serves the gzipped file directly.

Instead, you should link to file.css. The web browser will figure out that the gzipped file is there (nginx) and serve it, or will compress it itself.

4
  • But why it used to work on vinpin.com for example? Thanks
    – Tommy B.
    May 17, 2013 at 2:55
  • @Tom: It didn't work on vinpin.com. You had it configured to serve the gzipped files directly on vinpin.com and in instead served the regular files. That's an example of something not working. Computers are working when they do what you tell them to do. May 17, 2013 at 6:59
  • But how come it was working before? Now I configured nginx to automatically compress css and js. It seems to work for real now, basically once this is activated all I have to do is serve the files the way I served them before right? Thanks
    – Tommy B.
    May 17, 2013 at 13:21
  • @Tom: It wasn't working before. It just happened that it was doing what you actually wanted it to do while it was broken and not doing what it was told to do. May 22, 2013 at 9:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .