How can I use response caching in Blazor?

Platform: Blazor| Category: General

You need to add the Response Caching Middleware to the service collection in the startup class.

public void ConfigureServices(IServiceCollection services)
    {
       services.AddResponseCaching();
    }

Then, you can configure the app to use the middleware with the UseResponseCaching extension method, which adds the middleware to the Startup.Configure

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseResponseCaching();   
 }

Refer to this thread for more information.

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.