Google Speed Test - Enable Compression


(Drew Friestedt) #1

I’m trying to tune my CDN for the site https://discuss.endurancelab.fit.

When I run a google speed test I’m getting a recommendation to Enable Compression of the following:

When I run that same test on https://meta.discourse.org I get the following.

So meta.discourse.org is compressing the files that my site is not. I’m using cloudfront for my CDN. Any thoughts on how to get these files compressed?


Google Speed Test - js compression
(Matt Palmer) #2

That’s probably something you’d need to ask Cloudfront.


(Drew Friestedt) #3

OK - will do. In order to formulate my question to them, is there a header or some code that would indicate to the CDN to compress those files? Just want to make sure I’m specific in what I ask.

I suspect something is getting stripped or not read correctly and I’d like to indicate what that could be.

thx


(Matt Palmer) #4

It’s just the usual content encoding negotiation headers. Nothing special.


(Stephen Chung) #5

Your CDN is not compressing certain files that they should do by default.

Maybe there is a setting turning compression on or off. Make sure it is turned on. MOST CDNs also allow you to control compression by file type (i.e. MIME type) so things that are already compressed, like JPEG pictures, will not be compressed twice.

So you need to call up your CDN and say:

Hey, my files are not compressed (gripped in tech lingo). What should i do to turn on compression?


(Sam Saffron) #7

The css file not being compressed is added to my list

Will get it sorted


(Sam Saffron) #8

This is some crazy banana level stuff:

I just enabled gzip_proxied: any in our template per:

NGINX explicitly do not serve gzipped content to CDNs that send through a Via header (for dynamically compressed stuff)

The reason appears to be that:

it is reasonable to compress responses only to requests that will not be cached on the proxy server

Now my guess here is that this is some sort of crazy scheme where they are

  • Either trying to account for bad proxies sending bogus headers

  • Or, are trying to save a handful of CPU cycles

Both reasons do not make sense to me so I am setting our template to something saner.

EDIT confirmed the fix, so closing.


(Sam Saffron) #11

This topic was automatically closed after 27 hours. New replies are no longer allowed.