Renato Bezerra
Renato Bezerra

Reputation: 886

problem with browser cache

I'm having a problem with ASP.NET MVC 1.0.

The first time I access a View "Products", its ActionResult method is called without a problem (I used a breakpoint to see it).

But, if I access a View "ProductsOrders", for example, and try to go back to "Products" by pressing browser go back button, the "Products" ActionResult is NOT accessed, just its javascript file.

Why can I only access the "Products" the javascript file when I go back but the ActionResult don't?? Shouldn't the Action be called again as well?

Thanks!

Regards

Upvotes: 1

Views: 289

Answers (1)

chris166
chris166

Reputation: 4807

No, not necessarily. When you hit the browser's back button, the page usually comes from the browser's cache. If you want to prevent that, you shouldn't allow the browser to cache the page. It's even possible that it comes from the ASP.NET output cache (or a web proxy in between), in that case your action wouldn't be called either...

Just saw a related question that could help you with that: Disable browser cache for entire ASP.NET website

Upvotes: 2

Related Questions