Blazor WASM 服务器缓存
我正在遭受显示过时数据的应用程序,直到应用程序在Azure面板中重新启动。
它不会在Visual Studio 2020中的调试模式下进行本地发生,
我正在使用实体框架6
,这是对数据库的直接调用,以提取订单的详细信息。
我已经搜索过,但找不到有关服务器端缓存的任何提及。
在_host.cshtml中,我添加了以下客户端JavaScript:
<script type="text/javascript">
caches.delete("blazor-resources-/").then(function (e) {
console.log("'blazor-resources-/' cache deleted");
});
</script>
删除本地缓存。
刷新浏览器也不会刷新数据。
谁能提供任何建议?
I am suffering from my app displaying out of date data until the application is restarted in the azure panel.
It doesn't happen locally in debug mode in Visual Studio 2020
I am using Entity Framework 6
It's a straight forward call to the database to pull details of an order.
I have searched but cannot find any mention of caching on the server side.
In _Host.cshtml I have added the following client side javascript:
<script type="text/javascript">
caches.delete("blazor-resources-/").then(function (e) {
console.log("'blazor-resources-/' cache deleted");
});
</script>
to delete the local cache.
hard refreshing the browser doesn't refresh the data either.
Can anyone offer any advice please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能没有关联,因为您是通过数据库引用数据。但是我知道,当我从Glazor Wasm开始时,直到我了解有关服务人员的更多信息,我就遇到了很多问题。我确实提出了一个快速旁路 ...您可以尝试查看这是否能快速解决您的缓存问题。如果确实如此,我建议您更多地了解服务工作者并自定义您自己的项目实施。
May not be related since you are referencing data via a database. But I know I had a ton of issues around caching and deployment when I began with Blazor Wasm until I learned more about the Service Worker. I did come up with a quick bypass... which you can try and see if this solves your caching issue real quick. If it does then I suggest learning more about the Service Worker and customizing your own implementation for your project.