ScriptaGames / zorbio

A 3D multiplayer WebGL game
MIT License
8 stars 1 forks source link

Figure out why cloudflare is not gziping index.html #496

Closed Jared-Sprague closed 6 years ago

Jared-Sprague commented 6 years ago

I was curious what the gziped size of index.html on prod was when minified and even though the content-encoding says gzip the it doesn't look like it's actually compressing it from chrome dev tools:

screenshot from 2017-10-19 00-03-11

screenshot from 2017-10-19 00-04-53

mwcz commented 6 years ago

That's really weird! I wonder if cloudflare has an upper limit on filesize for gzipping... it's over 1MB ;)

Jared-Sprague commented 6 years ago

I figured this out I think: I think since the page is so large cloudflare is using transfer-encoding: chunked

screenshot from 2017-11-08 00-34-57

and I read here: https://en.wikipedia.org/wiki/Chunked_transfer_encoding

That if you use that header you can't include a content-length header. I think this is why chrome isn't reporting it. But firefox does:

screenshot from 2017-11-08 00-34-30

I think cloudflare is gzipping but chrome is just hiding it.