I'm a professional writer and software developer with more than 10 years of experience. I have worked for a lot of businesses and can share sample works with you upon request. Chat me up and let's get started.....
Into ASP.NET MVC, the OutputCaching basically allows you to store the output of a particular controller in the memory. So, any future request coming for the same action in that controller will be returned from the cached result. This way, the same content does not need to be generated each and every time the same controller action is invoked.
VaryByParam
VaryByHeader
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddOutputCaching();
services.AddMvc();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseOutputCaching();
app.UseMvcWithDefaultRoute();
}
}
Liked By
Write Answer
What is OutputCache Attribute in ASP.NET MVC ?
Join MindStick Community
You have need login or register for voting of answers or question.
Shrikant Mishra
19-Dec-2020Into ASP.NET MVC, the OutputCaching basically allows you to store the output of a particular controller in the memory. So, any future request coming for the same action in that controller will be returned from the cached result. This way, the same content does not need to be generated each and every time the same controller action is invoked.