Add to Google

> Main > Archive > 2011 > May > SetMaxAge in ASP.Net MVC Not Working

SetMaxAge in ASP.Net MVC Not Working
If you are trying to write an http handler in ASP.Net MVC and Response.SetMaxAge is not being passed in the response header, you need to first call Response.SetSlidingExpiration(true) first. Here is the code I use.

response.Cache.SetSlidingExpiration(true);
response.Cache.SetMaxAge(TimeSpan.FromDays(1));


Comments

No one has commented yet.
Add your comment
Name :