Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 21, 2012 08:12 AM by Young Yang - MSFT
Nov 14, 2012 06:26 PM|LINK
So I'm going through tutorials and trying some stuff out on my own in ASP.NET MVC 4. I've got a page displaying information pulled from a database and each row has a 'Select' ActionResult. This directs them to a different page and displays more information
on that specific row they clicked on.
My problem is when I click the back button on the browser, it displays a old cached version of the page. I know this because I changed the color of the table and even the information in the table is some what out dated compared to the database. If I hit
refresh or click the ActionResult it loads the page perfectly fine. I have been through just about every fix I could find on the internet to disable/clear caches for IE and STILL cannot resolve this issue. Works great in other browsers..
If someone could please give me some guidance, it would be very much appreciated!!
Edit: I just came across something interesting. If I press F12 then under the Cache menu check 'Always refresh from server' my problem goes away. I'm still confused as to how to work around this though!
Nov 15, 2012 11:33 AM|LINK
Morning bump. Hoping to find a solution to this problem.
Nov 15, 2012 05:21 PM|LINK
So I am really stumped and have no other ideas. I click the ActionResult to go to another page, when I hit back in the browser its showing a very old version of that view. When I hit refresh (not ctrl +f5) it loads the page perfectly fine! ONLY doing this
in IE, works fine in every other browser. Tried EVERY option out there and cannot get this working. If "Always refresh from server" is checked it fixes the problem.
Someone please help!!
Nov 15, 2012 05:29 PM|LINK
Which version of IE?
Nov 15, 2012 06:07 PM|LINK
Been testing with IE9
Edit: Seems to be a MVC 4 issue. I just created a fresh solution and used MVC 3. No cache problems and everything seems to be operating just fine. Didn't even have to turn cache off or clear it..
Would still love to figure out why it is not working properly in MVC 4, even after turning off the cache. Even clearing it to see my old page is still very weird! Where is it pulling it from??
Nov 15, 2012 08:09 PM|LINK
Try these meta tags in your headers, not all browsers handle cacheing the same way out of the box.This should work across them all.
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /><meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" />
Nov 16, 2012 11:35 AM|LINK
Unfortunately that doesn't work either. I really have tried every method of clearing\preventing caches that I could find on the web. From the meta to response events and event generating random numbers to append to a script file. Nothing works in MVC 4 and
IE unless I check "Always refresh from server". Thats the ONLY way I can hit the back button in the browser and not see this old version of the page.
Nov 21, 2012 08:12 AM|LINK
Hope this helpful