Chrome/Safari encoding problem

I’m trying to set up a website using grav and are seeing some strange things.

After setting it up, the webpage in Chrome and Safari is just looks like wrongly encoded mess. However, using firefox or CURL can get current result. I have tried it both locally (a Mac) and remotely (a linux) same result.

Encoding setting (UTF-8) seems right from what I get from CURL. both in the HTTP header and in HTML. Can anyone shed some light on this?

It is a Nginx/HHVM stack if thats matter.

the address is here:

http:// wp.testlifeinuk.com

After some investigation, it seems to do with the content-encoding header.

If I save the page directly from chrome, and then zcat it, I can see the result. Seems that Chrome doesn’t unzip it when displaying.

Further investigation shows that the in Chrome, the response header contains both:
Content-Encoding: none
Content-Encoding: gzip

I guess it is the first one that puzzled Chrome.

I’m not quite sure why this happens though. The setting seems working OK with other PHP pages and Wordpress.

Has anyone have a success installation with Nginx/HHVM, without any specific configuration?

Grav only sets Content-Encoding: none https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Grav.php#L436 when system.cache.gzip (“Gzip compression” in the Admin plugin system configuration) is disabled. Not sure what is adding Content-Encoding: gzip on the other hand.

I tested a frew more things in the mean time.

  1. still HHVM but change the gzip configuration to true
    -> 500
    E_WARNING - Invalid argument: function: method ‘ob_gzhandler’ not found

  2. switch to php5-fpm and with the gzip configuration set to true:
    -> 500 didn’t show a error message.

  3. still using php5-fpm, and with gzip set to false
    SUCCESS.

So the gzip setting seems problematic with Nginx.

If this seems to be a legitimate issue with Nginx, can you add a ticket here: https://github.com/getgrav/grav/issues and I’ll make sure it doesn’t slip through the cracks.

Thanks!