Prohibition of web cache

xiaoxiao2021-03-05  21

About prohibiting caching methods, share with you: 1. In many scenarios I found, there is a suggestion to prohibit page cache. Specifically, the server side script is used, as shown below: <% response.buffer = true; response.expiresabsolute = datetime.now - new timeSpan (1, 0, 0); response.expires = 0; response.cachecontrol = "no- Cache ";%> This method is very effective! It forces the browser to re-access the server download page instead of reading the page from the cache. When using this method, the programmer's main task is to create a session-level variable, determine if the user still views the page that is not suitable for passing the back button. Since the browser no longer caches this page, the browser will re-download the page when the user clicks the back button. At this time, the program can check the session variable to see if the user should be allowed to open this page.

2, join "in

3, add response.cache.setnostore (); your code can be added to Page_Load

4, code response.expiresabsolute = datetime.now - new timeespan (1, 0, 0); your code can be added to Page_Load

转载请注明原文地址:https://www.9cbs.com/read-38660.html

New Post(0)