I have web page that uses no-cache mechanism for not to let browser to cache content. However, I have some doubts. The developer has inserted no cache code into the PageLoad method in MasterPage.
It is like this (on Page Load in Master Page)
HttpContext.Current.Response.CacheControl = "no-cache"
HttpContext.Current.Response.AddHeader("Pragma", "no-cache")
HttpContext.Current.Response.ExpiresAbsolute = DateTime.Now.Date
HttpContext.Current.Response.Expires = -1
I have some doubt that this is the correct action and whether this could should be better inserted into BasePage OnInit
event?