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

前端 未结 5 1764
心在旅途
心在旅途 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:03

    RFC 2616 §13.13 says that History and Cache are different things. There should be absolutely no way for cache to affect Back button.

    If any combination of HTTP headers affects Back button, it's a bug in the browser …with one exception.

    In HTTPS browsers interpret Cache-control: must-revalidate as request to refresh pages when Back button is used (Mozilla calls it "silly bank mode"). This isn't supported in plain HTTP.

提交回复
热议问题