从外网访问时 css/js 会被缓存
这对我来说是一个奇怪的案例。
我们的组织内部有一个运行的 tomcat 服务器。我们在同一个 tomcat 服务器上部署了一个应用程序。当我访问 tomcat 所服务的网站时,浏览器根本不会缓存所有 js/css 文件,这意味着它为每个请求返回状态代码 200。
但是他们这个周末开放了在家工作的端口,当我从家里访问该网站时,令人惊讶的是那些 css 和 js 被缓存了(http 代码 304)
你们认为可能是什么原因?
This is a sort of curious case to me.
We have a tomcat server running in-house in our organization. We have a deployed an application on the same tomcat server. When I accessed the website the tomcat is serving, all the js/css files are not cached by the browser at all, which means it is returning status code 200 for every request.
But they opened the port for being able to work from home this weekend, and when I accessed the website from my home, surprisingly those css and js are cached (http code 304)
what do you guys think could be a reason?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的浏览器可以有不同的缓存设置吗?比如这个IE设置: https:// superuser.com/questions/81182/how-to-force-internet-explorer-ie-to-really-reload-the-page
您还可以使用 Firefox + Firebug 查看响应标头,您对缓存选项卡上的“过期”设置特别感兴趣。
Could you have different cache settings on your browsers? Such as this IE setting: https://superuser.com/questions/81182/how-to-force-internet-explorer-ie-to-really-reload-the-page
You could also use Firefox + Firebug to take a look at the response header, your particularly interested in the "expires" setting on the cache tab.