gpt4 book ai didi

html - 如何阻止 html 网络下载相同的图像?

转载 作者:行者123 更新时间:2023-11-28 00:31:42 28 4
gpt4 key购买 nike

这是我的游戏:https://colonist.io/

游戏中有聊天部分,显示谁掷了哪些骰子并获得了用 HTML 编写的哪些资源。

enter image description here

因此,每当掷骰子时,都会打印 10 张图像。这些图像中的每一个都进行网络调用。我通常希望网络调用不会下载相同的图像,但由于某种原因它会下载,而且我找不到让浏览器从缓存中使用它的方法。

response headers设置为:public, max-age=14400request headers设置为:cache-control: no-cache

所以我猜测问题与请求 header 有关,但我找不到更改它的方法。

我怎样才能打印新的 HTML <img src="../dist/images/card_lumber.svg?v56">它不进行额外的网络调用吗?

最佳答案

这只是一种预感,但请确保您已在 chrome 开发人员工具的网络选项卡中取消选择 disable cache 按钮。

enter image description here

关于html - 如何阻止 html 网络下载相同的图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58602259/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com