Chrome开发工具显示高缓存存储利用率 [英] Chrome dev tools showing high cache storage utilisation

查看:76
本文介绍了Chrome开发工具显示高缓存存储利用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在分析我们在网站中实现的服务人员和缓存存储。

I was analyzing the service workers and cache storage we have implemented in our website.

在整个过程中,我发现由...使用的缓存存储量该网站是巨大的。

Going through the process, I found out that the amount of cache storage used by the website is huge.

我要添加到缓存存储中的文件的累积大小不超过 5-6 MB 。但是在chrome开发工具中,它显示了大约 131 MB 的存储空间。

The cumulative size of the files that I am adding to cache storage is not more than 5-6 MB. But in the chrome dev tools, it shows approximately 131 MB storage used.

OS X上的Chrome63。

Chrome 63 on OS X.

在隐身模式下,其使用率高达 100 MB 导致超出配额错误

In incognito mode it shows usage as high as 100 MB which causes Quota Exceeded error .

从chrome设置中清除浏览数据,然后重新加载网页(带宽速度-1MBps),仅在4-5秒后,存储空间显示为130 MB,这实际上是不可能的,因为

Even after clearing browsing data from chrome settings, and reloading the webpage (bandwidth speed - 1MBps) , just after 4-5 seconds the storage use is shown as 130 MB which is practically not possible because

1)如上所述,我添加到缓存中的实际数据大小为5-6 MB。

1) As mentioned above my actual data size added to cache is 5-6 MB .

2),即使以某种方式获得了130 MB(我不知道如何),但由于我的带宽限制,无法下载130 MB。

2) even if it was somehow getting 130 MB (I don't know how), downloading 130 MB is just not possible given my bandwidth limitations.

这里可能是什么问题?
为什么显示如此高的缓存存储量?

What might be the issue here ? Why does it show such high cache storage usage?

推荐答案

此问题与Chrome浏览器显示了高速缓存存储空间的使用情况,直到关闭为止,我将在这里留下答案可见度。关闭后随时删除。

This question is a duplicate of Chrome shows high cache storage use and until it gets closed, I'm going to leave an answer here for visibility. Feel free to delete after closing.

另请参见不透明响应的局限性

每个不透明响应( (未启用CORS时向远程源发出请求的结果),甚至是100字节的GIF,平均也要花费 7 MB缓存

Each opaque response (the result of a request made to a remote origin when CORS is not enabled), even a 100-byte GIF, takes on average 7MB of cache.

解决方案包括添加 crossorigin = anonymous 脚本和 img 标签中的,并删除 {模式: 'no-cors'}

Solutions include adding crossorigin="anonymous" in script and img tags, and removing { mode: 'no-cors' }.

这篇关于Chrome开发工具显示高缓存存储利用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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