Cache control header prevents proxy from minifying CSS/JS

Created on 21 July 2020, almost 4 years ago
Updated 14 July 2023, 12 months ago

I have a client site that uses Cloudflare as a WAF, proxy, and CDN. They have an option to automatically minify CSS and javascript and then serve the compressed bundles from their CDN. Therefore I disable Advagg's CSS and JS compression to reduce the dependencies and save some CPU cycles on our origin server.

However I noticed Cloudflare was not minifying anything. With help from their support we discovered that Advagg is setting the following header on the aggregate bundles:

header('Cache-Control: max-age=31449600, no-transform, public');

That no-transform directive is stopping their intermediate servers from minifying the aggregates. I can confirm that removing it manually fixes the problem.

Could it be made optional, or perhaps the entire header could be stored as a Drupal variable that can be overridden? That would allow us to also modify the max-age time and/or set other directives if desired.

✨ Feature request
Status

Closed: duplicate

Version

2.33

Component

Code

Created by

🇮🇳India parul99

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024