是否可以使用 Javascript 使 .manifest 缓存失效?

发布于 2024-12-15 13:09:35 字数 236 浏览 2 评论 0原文

我们当前正在构建的 Web 应用程序使用 .manifest 文件使其可以离线使用。在应用程序的右上角,我们显示用户名。所有其他上下文都是通过 ajax 请求的。

现在的问题是,当用户注销并且其他用户登录时,用户名字段保持不变,因为浏览器已经缓存了该页面。

所以我的问题是:是否可以使用javascript在注销时使清单文件失效?

我知道我们也可以通过 ajax 填充用户名字段。

感谢您的帮助

The Webapplication we're currently building is using a .manifest file to make it available offline. In the top right of the application we display the username. All other context is requested through ajax.

Now the problem is that when the user log's out and a different one logs in the username field stays the same because the browser cached that page already.

So my question is: Is it possible to invalidate the manifest file upon logout with javascript?

I am aware that we could fill the username field through ajax too.

Thanks for your help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一江春梦 2024-12-22 13:09:35

尽管我不知道以编程方式执行此操作,但 Web 应用程序的一个常见模式是使用应用程序缓存来存储所有用户共用的资源,并使用其他存储机制(localStorage、indexedDB 等)来存储特定的资源。用户数据。

As much as I don't know a programmatically way to do it, a great common pattern for web apps is to use app cache for the resources that are common to all users and use other storage mechanisms (localStorage, indexedDB, etc) for specific user data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文