David Thielen
David Thielen

Reputation: 32986

What is the difference between PersistentComponentState and MemoryCache?

For Blazor InteractiveServer render mode, the Microsoft documentation suggests that on the pre-render call I read the needed data for the page and save it to the PersistentComponentState. Then on the 2nd call to OnInitializeAsync, read from the PersistentComponentState to populate the page.

Why wouldn't I just use MemoryCache? Reading the Microsoft documentation it looks like this is an app global data store, not a per circuit store. So I think MemoryCache is basically the same thing... is that correct?

Upvotes: 3

Views: 300

Answers (0)

Related Questions