How to disable caching of html: First open the corresponding HTML file; then use the "" statement to disable caching of the page.
The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer
HTML page caching is prohibited
Everyone may have encountered the problem of page caching. Many functions have no effect after completion, so how to solve this problem? Here is my solution
For an html page, caching Divided into 3 parts, one is page content, one is css style, one is JS file
1, page content
<meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-control" content="no-cache"> <meta http-equiv="Cache" content="no-cache">
2, CSS and JS file
<link rel="stylesheet" href="../css/register.css"/> <script src="../scripts/register.js"></script>
changed to
<link rel="stylesheet" href="../css/register.css?v=20161020"/> <script src="../scripts/register.js?v=20161020"></script>
Just change the version number after each modification
In this way, you have to change it after every modification. Is there anything that automatically adds the version number? I guess there is, if it is JSP and php can be automatically generated through script
. If it is pure html, it can also be generated through document.write, or a dynamically loaded JS framework or something.
Recommended study: "HTML Video Tutorial"
The above is the detailed content of How to disable caching in html. For more information, please follow other related articles on the PHP Chinese website!