Google Speed Test - Enable Compression

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?

1 Like

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

1 Like

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

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

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?

The css file not being compressed is added to my list

Will get it sorted

7 Likes

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.

7 Likes

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