---
canonical: "https://www.jsolly.com/blog/cloudflare-minify-optimizations-broke-sri/"
title: "Solve CloudFlare's 'Auto Minify' and Subresource Integrity Conflict"
description: "Fix CSS and JS breaking on your website caused by CloudFlare's 'auto-minification' by turning off optimizations and implementing minification server side."
author: "John Solly"
published: "2022-05-26T13:45:42.000Z"
updated: "2026-09-07T14:25:05.478Z"
---

<a id="solve-cloudflares-auto-minify-and-subresource-integrity-conflict"></a>

# Solve CloudFlare's 'Auto Minify' and Subresource Integrity Conflict

![Screenshot of CloudFlare's auto-minify for HTML, CSS, and JS](https://d1d7p8ufhgz4ld.cloudfront.net/media/post_metaimgs/cloudflare_auto_minify.png)

After [implementing subresource integrity](https://www.jsolly.com/blog/how-to-implement-subresource-integrity-django/) and [switching over to CloudFlare](https://www.jsolly.com/blog/free-cdn-for-17x-speed/), I noticed resources like CSS and JavaScript were breaking on my site. I ran into the same issue as [this guy](https://valer.dev/posts/subresource-integrity/). CloudFlare presents these options and I didn't think twice about turning them on.

![CloudFlare interface showing three checkboxes for 'Auto Minify'...HTML, CSS, and JS](https://d1d7p8ufhgz4ld.cloudfront.net/media/post_imgs/cloudflare_auto_minify.png)

Because there's an integrity hash on these files, they fail to load when modified. CloudFlare's 'auto-minification' changes, causing the hash check to fail.

After turning off these optimizations, CSS and JavaScript started loading again (after purging the cache). I still want to minify my CSS and JS, but I'll have to implement it on the server side.

May 26, 2022 in [Web Dev](https://www.jsolly.com/blog/category/web-dev/)

Updated September 7, 2026
