AngularJS浏览器缓存的问题 [英] AngularJS browser cache issues

查看:245
本文介绍了AngularJS浏览器缓存的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好,我在生产environement一个Web应用程序。每天用户都在使用它,当我发布更新和用户回来到Web应用程序,他认为旧版本的Web应用程序。他需要刷新浏览器加载新版本。我怎样才能解决这个问题?我不能告诉数百个用户的每一次发布更新时间(3-4次一周),以刷新页面。

Good morning, I have a web application in production environement. The users are using it every day, when I publish an update and a user comes back to the web application he views the old version of the web application. He needs to refresh the browser to load the new version. How can I solve this problem? I cannot tell hundreds of users to refresh the page every time I publish an update (3-4 times a week).

推荐答案

一个简单的解决办法是添加的查询字符串重新presenting时间戳或会话ID 以您的文件。

A simple solution would be to add query strings representing timestamp or session id to your files.

有关例如,在我们的Spring应用中,我们简单地使用:

For e.g., in our spring applications, we simply use :

<script src="js/angular/lib/app.js?r=<%= session.getId()%>"></script>

您可以在您的服务器相同的解决方案具体实施了。

You can implement the same solution in your server specific implementation too.

这篇关于AngularJS浏览器缓存的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆