Our company downloads the project from SVN to the local, and then uploads it to the server after modifying it locally.
The current problem is that when several styles are modified locally, or externally linked js is previewed in the browser, the changes cannot be seen due to caching, and the cache can only be manually cleared. However, it is more troublesome when modifications are frequent. After looking at the method of adding timestamps to fis, it seems that the project is only reconfigured when deploying or updating. Is there any good method for this kind of local modification?
为情所困2017-05-16 13:26:25
Disable cache through chrome
chrome dev tools > networks > disalbed cache, see the picture below
phpcn_u15822017-05-16 13:26:25
You can use Chrome’s clean cache plug-in. Just click the button of this plug-in every time you refresh the page. You don’t need Chrome’s refresh button
我想大声告诉你2017-05-16 13:26:25
It is recommended to use a build tool such as webpack or gulp. When building the project, put the version number after the file to trigger the browser request.
ringa_lee2017-05-16 13:26:25
After each modification, you can add a timestamp after the file to ensure that the requested file is a newly modified file, like the following
<link rel="stylesheet" href="css/main.css?i=2017051101">
<script src="js/config.js?i=2017051101"></script>
PHPz2017-05-16 13:26:25
The button on the page can be forced to refresh
Button binding event location.reload()