What's the best way to deal with cache and the browser back button?

前端 未结 5 1761
心在旅途
心在旅途 2021-02-06 03:24

What\'s the best way to handle a user going back to a page that had cached items in an asp.net app? Is there a good way to capture the back button (event?) and handle the cache

5条回答
  •  耶瑟儿~
    2021-02-06 04:24

    The best way to deal with it is to probably put a no-cache directive in your ASP.NET pages (or a master page if you're using one). I don't think there's a way to deal with this directly in your ASP.NET code (since the cache decision is happening on the client).

    As for MVC, don't know how you would accomplish that (assuming it's different from Web Forms-based ASP.NET); I haven't used it.

提交回复
热议问题