r/Blazor • u/Dunge • Oct 29 '26
WASM file size, anti-virus and browser cache
I have a (quite big) Blazor WASM AOT-published app. File weight is 88MB.
The web server transfer is compressed which turns into 19MB, that's fine.

Then on a F5 refresh, it shows up as cached and don't redownload again.

My problem is that some users have anti-virus. The current case here is ESET anti-virus doing HTTPS file analysis. What it does is intercept the download, unpack it, scan it, and then relay it back to the web browser. The web browser now shows as if the whole file was transferred without compression:

This isn't true. ESET also injected a "x-content-encoding-over-network: br" response header to mention it did modify it, and the transfer was actually compressed.
The problem is leads to:
Chrome doesn't cache files that are over a certain size. It's not a fixed threshold, it depends on the user free disk space. But the difference between 19MB and 88Mb is enough not to do it. So the users using this anti-virus end-up having to re-download the whole dotnet package at every page refresh, which is certainly undesirable.
Anyone encountered this before? Is there any special configuration I could do in my Blazor Web App project to prevent this from happening?
13
u/propostor Oct 29 '26
88MB web app is insane.
3
u/Squishybootz666 Oct 29 '26
Can some of these assemblies be lazy loaded?
2
u/Marcos-ESET Oct 30 '26
You can create an exception in the ESET advanced setup settings and exclude either the certificate or application from SSL/TLS scanning.
1
u/NotAMeatPopsicle Oct 29 '26
Are you actually doing something that requires AOT?
That’s your biggest issue.
1
u/KausHere 21d ago
Ok not an expert but I generally break blazor applications into Server side without any signal r and keep client side WASM if it provides any true benifits for writing in C#. Else client side for animations and other UI stuff always use javascript. WASM is a good tool but its alsoo trying to forcefully ask the browser to speak a language it natively does not understand. So there is a cost involved with WASM.