Google PageSpeed says to enable compression for code.getmdl.io #4319

Open
DanTup opened this Issue May 1, 2016 · 16 comments

Projects

None yet

6 participants

@DanTup
Contributor
DanTup commented May 1, 2016

I don't know if this is being reported correctly, but when I run my site through PageSpeed, it reports this:

Enable compression
Compressing resources with gzip or deflate can reduce the number of bytes sent over the network.
Enable compression for the following resources to reduce their transfer size by 49.4KiB (81% reduction).
Compressing https://code.getmdl.io/1.1.3/material.min.js could save 49.4KiB (81% reduction).

In Chrome dev tools, the size is reported as 60.9 KB and I can't see anything about compression in the response headers (but I'm not sure if it's normally visible here).

Is this expected?

@Garbee
Collaborator
Garbee commented May 1, 2016

@crhym3 Can we enable gzip compression on the CDN using Google Cloud Storage? Checking the response headers it certainly isn't being zipped.

@x1ddos
Contributor
x1ddos commented May 1, 2016

gzip compression is enabled. getmdl.io is served in exact same way as code.getmdl.io, it's just a matter of how files are uploaded to code.getmdl.io

whoever deploys assets to code.getmdl.io (@sgomes maybe?), they need to do it with gzip enabled.

@x1ddos
Contributor
x1ddos commented May 5, 2016 edited

@sgomes and I debugged this a bit just now. It became clear this is happening at serving time but not for all browsers. For instance, Firefox seems to be getting gzipped content, while Chrome, Safari and Opera don't.

I'll assign this bug to myself for now. Will investigate more.

@x1ddos x1ddos self-assigned this May 5, 2016
@x1ddos
Contributor
x1ddos commented May 5, 2016

This is how gzipped content is served at the moment:

We use a combination of request headers (Accept-Encoding, User-Agent) and response headers (Content-Type) to determine whether or not the end-user can take advantage of gzipped content. This approach avoids some well-known bugs with gzipped content in popular browsers. To force gzipped content to be served, clients may supply 'gzip' as the value of both the Accept-Encoding and User-Agent request headers. Content will never be gzipped if no Accept-Encoding header is present.

@DanTup
Contributor
DanTup commented May 5, 2016 edited

Is this something you think could be tweaked? If Chrome, Safari, Opera and PageSpeed are all being served uncompressed content, it sounds like the logic might not be working as well as expected!

@Garbee
Collaborator
Garbee commented Jul 11, 2016

Running against https:://getmdl.io currently isn't yielding any compression issues which is using the code subdomain for resources. Therefore this seems to have been fixed.

Thanks for the report.

@Garbee Garbee closed this Jul 11, 2016
@DanTup
Contributor
DanTup commented Jul 12, 2016

Yep, LGTM. Thanks!

@LsKs
LsKs commented Sep 20, 2016

Is it actually fixed? Google PageSpeed is actually complaining about version 1.2.1

Compressing https://code.getmdl.io/1.2.1/material.min.js could save 49,6 KB (81% reduction).

image

@x1ddos
Contributor
x1ddos commented Sep 20, 2016

screenshot from 2016-09-20 13 44 19

I don't know what checkgzipcompression.com is.

@sgomes
Contributor
sgomes commented Sep 20, 2016 edited

Just tested it too, and I can confirm the file is coming back with gzip compression, looking at the response headers. And that site is definitely not Google PageSpeed :)

@LsKs
LsKs commented Sep 20, 2016 edited

True, same on my end. Any idea why PageSpeed is complaining?

ss

EDIT: Included screenshot from PageSpeed.

@sgomes
Contributor
sgomes commented Sep 20, 2016 edited

@LsKs Just tested by running an MDL-using site through PageSpeed Insights, and I can confirm that it does indeed complain about compression not being enabled, even though opening the site in the browser does show compression headers being used. This may be a bug with the tool.

@Garbee
Collaborator
Garbee commented Sep 20, 2016

I just tested here by opening the same JS file in Chrome and checking the headers, I do not see gzip in mine. Looks like the server is only gzipping in some cases and not others.

Re-opening for investigation.

no-gzip

@Garbee Garbee reopened this Sep 20, 2016
@x1ddos
Contributor
x1ddos commented Sep 20, 2016

This might be an App Engine issue, our host.
I'll report back here when I find out more.

Worst case, we might just move off of App Engine, if gzip is worth it and we can't fix it in the current environment.

@Garbee
Collaborator
Garbee commented Sep 20, 2016

Gzip is extremely important. Worth moving off App Engine if it can't be stable there.

@zogthealien

Any progress on this? Still getting gzip errors on my website using the CDN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment