I noticed that when I Response.Redirect on an .aspx page, it sometimes displays a cached page instead of actually executing the page and pulling fresh data from the database.
I don't use output caching or something special in .Net here - it's CRM, and caching happens either on the client, or perhaps more likely automatically in IIS.
Meanwhile, by the way, the request is not added to it. I pass the key through the session. I know that if I used querystring, this probably partially circumvented the caching issue, but in this case it is not an option, and in any case I really want to get a deeper understanding of what is happening.
I did a bit of work, and some people will get around this using Server.Transfer (which actually behaves differently than Response.Redirect, and some details are not always desirable), and some others said to set Response.Cache.SetCacheability (HttpCacheability .NoCache) on the page where I want to avoid caching.
I would like to better understand what is going on here, and perhaps best practice - firstly, I thought that .aspx pages were always tagged to avoid caching. Correctly?
Any thoughts?
source
share