Search code examples
google-cloud-platformgoogle-cloud-storagegoogle-cloud-cdn

GCP Cloud CDN will not compress content when set to "Automatic"


GCP Cloud CDN does not compress any responses when the strategy for compression is set to AUTOMATIC (as it should per the docs) (UI of the CDN in question).

No compression takes place, and no content-encoding header is sent, even tho an accept-encoding header (gzip, deflate, br) is sent.

A prime example of an ~300kb file not being compressed appropriately can be found behind a CDN here: https://himmer.software/main.6a971e1e28a0da9a.js (as of 30.11.2022). The object in question in the connected backend bucket: Object

I feel I must be overseeing something, the mime type and request headers are correct, so having the compression mode set to automatic should return a compressed version of the object.

I set compression mode to AUTOMATIC, set back to DISABLED and back to AUTOMATIC, ran v1.compute.urlMaps.invalidateCache with /* on the load balancer (invalidated all records AFAICT), but still nothing.


Solution

  • Are you using the new Google Global Load Balancer or the Classic Load Balancer? Dynamic compression is not currently supported on the new GCLB option, only the Classic GCLB at this time.