I'm having problems with IIS cache (I believe the problem is it) , whenever I make any changes to the database, the changes do not happen on the site, / p>
Changes only appear when I turn off and turn on IIS.
Attempts
I added this command in web.config
<caching enabled="false" />
In the controller, I also added this annotation
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
And finally, in global.asax
I added this method
protected void Application_BeginRequest()
{
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
}
None of these attempts worked, maybe the problem is not cache, I do not know ...
Controller
public class CursosController : Controller
{
private SiteContext db = new SiteContext();
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
public ActionResult Index(Cursos curso)
{
return View(curso);
}
}