.NET 7 Output caching in IIS

219 views Asked by At

I am using OutputCache in .NET7. Outputcache seems not working on IIS while it is working in my local or docker. Is there any configuration to set for IIS server?

builder.Services.AddOutputCache(options =>
{
    options.AddBasePolicy(builder =>
    {
        builder.Expire(TimeSpan.FromDays(1));
    });
});
app.UseOutputCache();

        [HttpGet]
        [OutputCache]
        public async Task<IActionResult> getsomefunction()
        {
            return Ok(somefunction());
        }

0

There are 0 answers