【发布时间】:2016-10-26 15:10:57
【问题描述】:
我在一个应用程序中工作,我看到 JS 和 CSS 文件加载为:
<script type="text/javascript" src="/js/jquery.livequery.js?1474472108"></script>
<link href="/js/jquery.cookiebar.min.css?1474472239" media="all" rel="stylesheet" type="text/css" />
如果我没记错的话,这是用于浏览器缓存的东西。我是对的? ? 之后的数字是使用 filemtime() 构建的,这是修改时间。
如果加载的文件从上个月开始没有被修改,并且将继续一年而不被修改,那么一直添加相同的值是否有意义?
【问题讨论】:
-
请不要标记为重复没有正确阅读,我问
If the file loaded hasn't been modified from the last month and will continue without being modified for one more year, makes sense to add the same value all the time?!!!! -
如果您有一个系统可以将缓存破坏代码设置为文件版本或上次更改的时间,那么是的,使用它是有意义的。未来多久保持不变并不重要。
-
我建议您将帖子标题更改为实际问题,以避免重复关闭投票。
标签: javascript css