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

问题描述 投票:1回答:1

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

[在游戏中,有一个聊天区,显示谁掷骰子并获得了用HTML编写的资源。

enter image description here

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

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

因此,我猜测问题与请求标头有关,但我找不到改变它的方法。

如何使它在打印新的HTML <img src="../dist/images/card_lumber.svg?v56">时不进行额外的网络呼叫?

html networking request-headers response-headers
1个回答
0
投票

这只是预感,但是请确保您已取消选中chrome开发人员工具的网络标签中的disable cache按钮。:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.