Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What cache strategy should be used for Blazor apps?

I've been testing out Blazor, and I can't find any documentation on how to implement browser caching (either with static files like images, css, js etc, but also the dll files that are downloaded).

Is it possible to cache static and dll files in Blazor at all?

like image 801
Paul Avatar asked Jan 22 '20 10:01

Paul


People also ask

What is the best caching strategy?

Cache-Aside (Lazy Loading) A cache-aside cache is the most common caching strategy available. The fundamental data retrieval logic can be summarized as follows: When your application needs to read data from the database, it checks the cache first to determine whether the data is available.

Does Blazor use WebSockets?

Blazor works best when using WebSockets as the SignalR transport due to lower latency, better reliability, and improved security.

How do you improve distributed cache performance?

Keeping total control of the server resources used for cache (cache keys and metrics, memory, CPU): Relieve the Front-end Server resources used for local cache. Allow external access to the runtime cache (Service Ops team, external applications outside of OutSystems factory, etc).


1 Answers

As of Blazor WASM 3.2-preview2 release, when an app is initially loaded, the runtime and framework files are now stored in the browser cache storage. When the app loads, it first uses the contents of the blazor.boot.json to check if it already has all of the runtime and framework files it needs in the cache. If it does, then no additional network requests are necessary.

You can read more about this in Improved framework caching section of the Blazor WASM release blog post.

like image 129
Artak Avatar answered Oct 03 '22 11:10

Artak