Sometimes in order to implement some functions (such as refreshing data in real time), the browser needs to get the data from the server instead of using the cache.
HTTP headers "Expires" and "Cache-control" provide a mechanism to control caching on the browser and proxy servers
Expires tells the browser when its cached page expires and can be 0
Cache-control notifies the browser not to cache any pages
Two headers are defined in RFC7234
For HTML pages, use the
<meta http-equiv= "Pragma" content= "No-cache" ><meta http-equiv= "Cache-control" content= "No-cache, Must-revalidate "><meta http-equiv=" expires "content=" 0 ">
Control
For a JSP or servlet, use the
Response.setheader ("Cache-control", "No-store"); Response.setheader ("Pragrma", "No-cache"); Response.setdateheader ("Expires", 0);
Control
Ways to keep pages from being cached