1

I have configured my Apache xampp server to serve gzipped content as described [here][1]. This works successfully on some Firefox and Chrome browsers I have tried on different PCs (Windows and Ubuntu). I could verify this by looking at Network tab in DevTools on Firefox and Chrome browser, where I can see the reduced size that is transferred and also the header Content-Encoding :gzip I also passed the [GIDZipTest][2].

The problem is that for my PC and also another laptop I found (Windows 10) the content is not received as gzip by any browser, although the browsers send the request header that they accept gzip. The weird thing is that when I tested this in the Firefox browser of my Ubuntu VM it receives gzipped content but when I test this in the browser of the PC that hosts the VM it does not receive gzipped content.

I attach some pictures.

Firefox on my PC[3], Chrome on my PC[4], Firefox on VM[5]

  1. https://ourcodeworld.com/articles/read/503/how-to-enable-gzip-compression-in-xampp-server
  2. http://www.gidnetwork.com/tools/gzip-test.php
  3. https://i.stack.imgur.com/9KLSO.png
  4. https://i.stack.imgur.com/gcLsW.png
  5. https://i.stack.imgur.com/UO9fA.png
Paul T.
  • 4,703
  • 11
  • 25
  • 29
bloox
  • 127
  • 2
  • 9
  • _“although the browsers send the request header that they accept gzip”_ - and that looks _exactly_ the same in both cases? Do you experience this only when testing in the VM? Might simply be a case of the host system filtering out certain request headers in that case, for whatever purpose. Have you logged the _received_ request headers on the server side? – CBroe Nov 01 '17 at 09:50
  • Yes they send the same request headers, but I was more referring to this one Accept-Encoding:gzip, deflate. My laptop and also another PC I have tested they receive gzip content, as well as my VM. I see the request headers from Network tab. Shouldn't be the same on the server side? – bloox Nov 01 '17 at 10:09
  • _“I see the request headers from Network tab. Shouldn't be the same on the server side?”_ - _should_, but don’t have to. Pretty much anything involved in the process could filter out specific headers. So go and check what the server receives. – CBroe Nov 01 '17 at 10:11
  • I used [this](https://stackoverflow.com/questions/541430/how-do-i-read-any-request-header-in-php) to get the request headers from my server. I tested Chrome for my PC and laptop. For both, headers are the same and Accept:"*/*",Accept-Encoding:"gzip, deflate" appear. In my laptop I receive gzip while in my PC I'm not. – bloox Nov 01 '17 at 10:49
  • Do you have any other tools installed that might interfere with this? Such as personal firewalls or similar, that might have decompressed the response already before it reaches the browser? Do you have the same problem with other gzipped sites in that browser, or just yours? – CBroe Nov 01 '17 at 10:52
  • The only difference is that in my laptop I have extra cookies: _ga=GA1.2.965192405.1496211098; __utma=180963839.965192405.1496211098.1506578869.1506578869.1; __utmz=180963839.1506578869.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); – bloox Nov 01 '17 at 10:52
  • That looks like Google analytics/tracking cookies, but those should not really have an influence here. (If you explicitly delete them from within your browser, and then request the page again, I expect nothing changes in regard to gzip?) – CBroe Nov 01 '17 at 10:54
  • Yes, I deleted them and nothing changed, I still receive gzip. So maybe it is a system issue and not a browser issue? – bloox Nov 01 '17 at 10:59
  • As for firewalls I disabled it as well as the antivirus and re-tested but the result was the same. The file came to the browser uncompressed. This occurs to my PC and one other laptop, but in all other PCs and laptops I have tested the content is coming gzipped. – bloox Nov 01 '17 at 12:05

1 Answers1

0

Finally it worked by replacing http with https..I don't know why this is required, since I'm using exactly the same version of browser in both cases!

p.s.CBroe was right. If I look request headers more carefully I can see that in the browser that was not accepting gzip content, the header Accept-Encoding had one more value apart from gzip and deflate, which is br aka Brotli which seems to support compression only for https! Could this probably be the explanation? Although I didn't make any configuration in xampp for Brotli..

bloox
  • 127
  • 2
  • 9