Search code examples
blazorblazor-webassemblyblazor-client-side

Blazor App not caching framework dll files


I have a Blazor app which doesn't appear to be caching any of the Framework files like it should be.

Every time I reload the page I get messages like:

Loaded 2.14 MB resources from network

But never the cache version:

Loaded 2.14 MB resources from cache

Additionally there is nothing in the Cache Storage in the browser:

enter image description here

This happens both in local debug and deployed release versions.

I've checked settings added to the .csproj and can confirm nothing is explicitly turning anything off.

I've checked and boot.blazor.json has the expected cacheBootResources: true

I've tried creating a blank Blazor App in Visual Studio and this works correctly.

Is there anything else in my App that could be causing the cache to be completely disabled?


Solution

  • After some brute force, trial and error code commenting; slightly strangely this turned out to be because of a piece of JavaScript referenced within the Index.html page. The class was named Response which I can only assume clashed with some of the bootstrapping code for Blazor. (Possibly the Response type used here?)