Hey everyone, I’m MAD! I’ve been struggling with Azure Static Web Apps compression for over a month. You read that right – A MONTH.
Microsoft’s official docs states that Brotli compression is enabled by default and yet every time I deploy and run the app I get the uncompressed files. Blazor WASM by itself is a huge monster and not being able to at least compress it was a huge pain.
I tried really everything I found on the web, many times, over and over again.
- Using decode.js and decode.min.js (ref Microsoft docs)
- Editing staticwebapp.config.json like a thousand times trying different things
- Using a compression step as part of my Github Actions CI/CD even though by default Blazor is compressed when published (I was that desperate after thousands of trial and errors)
Nothing worked.
So let me show you, dear internet stranger, what fixed my problems, as I’m sure many of you will struggle with this too, so hopefully this will save you some hair.
The issue was… my antivirus ESET NOD 32’s HTTP Scanner. Yeah, that’s right. This feature, called Protocol filtering, was behind my compression nightmares the whole time.
So the fix is easy – just whitelist your domain’s IP address:
Sadly I couldn’t find a way to make it work with a domain name, which is far less fragile than using IP. If you did, please share your sorcery with us in the comments.
Anyways, hopefully this will save you from the troubles and the sleepless nights I had to go through…
Happy coding, folks 🧑🏼💻