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!!
Thanks,
Andrew
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!
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.
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??
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.
rebaar
0 Points
5 Posts
IE Cache Issue
Nov 14, 2012 06:26 PM|LINK
Hello,
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!!
Thanks,
Andrew
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!
rebaar
0 Points
5 Posts
Re: IE Cache Issue
Nov 15, 2012 11:33 AM|LINK
Morning bump. Hoping to find a solution to this problem.
rebaar
0 Points
5 Posts
Re: IE Cache Issue
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!!
CodeHobo
All-Star
18647 Points
2647 Posts
Re: IE Cache Issue
Nov 15, 2012 05:29 PM|LINK
Which version of IE?
Blog | Twitter : @Hattan
rebaar
0 Points
5 Posts
Re: IE Cache Issue
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??
DylanTheDev
Member
2 Points
1 Post
Re: IE Cache Issue
Nov 15, 2012 08:09 PM|LINK
rebaar
0 Points
5 Posts
Re: IE Cache Issue
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.
Young Yang -...
All-Star
21111 Points
1817 Posts
Microsoft
Re: IE Cache Issue
Nov 21, 2012 08:12 AM|LINK
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Hope this helpful
Regards
Feedback to us
Develop and promote your apps in Windows Store