转自:https://blog.csdn.net/u011500781/article/details/53332926
问题重现
当我们需要开发手机端页面的时候,不得不在真机中调试
在微信中,可以通过微信提供的设置-通用-存储空间-清理微信(这是ios,android可能略不同)进行页面缓存的清理
在App中,就比较麻烦了,因为App一般不会像微信考虑的那么周全,给你提供清理页面缓存的途径
问题解决
像网上说的一些方法,经本人测试,都是无效的,如给head加meta标签:
<meta http-equiv="pragram" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="0">
自然而然,我们想到给文件加时间戳,如:
加时间戳前
<!DOCTYPE html>
<html lang="en">
<head>
<script src="js/test.js"></script>
</head>
<body>
<div class="body"></div>
</body>
</html>