Summary of common methods of clearing page cache with JSP
This paper summarizes the common methods of clearing page cache by JSP. Share with you for your reference, as follows:
1、 Clear page cache
In JSP page
In the HTML page:
2、 Clear cookies
3、 Clear session
Clear session method
To clear the session when the page is closed, you need to capture Windows Onclose event, and then call the clear session method
Add: how to use JavaScript code to clear the cache?
If random numbers cannot be generated at the server level, you can use JavaScript code to generate a string at the client (browser) level. The following example illustrates how to perform cache cleanup using standard image code or iframe / JavaScript code.
These are examples only. If you want to use this code, adjust the example for the specific HTML code. You must paste the actual code into the appropriate locations in these examples.
Standard image code example:
Iframe / JavaScript code example:
I hope this article will help you in JSP programming.