52ky 发表于 2022-4-28 08:38:55

生鲜速递:HTTP的缓存控制.pdf

缓存是计算机领域的一个重要概念,是优化系统性能的工具。
由于链接较长,网络延迟不可控,浏览器使用HTTP获取资源的成本很高。因此,非常有必要将“来之不易”的数据缓存起来,并在下次请求时尽可能重复使用。这样可以避免多次请求-响应的通信成本,节省网络带宽,加快响应速度。
试想一下,如果有几十K甚至几十M的数据,不是来自网络,而是来自本地磁盘,那将是一个巨大的节省,并且避免了多少等待时间。
实际上,HTTP传输的每一个环节基本上都有一个缓存,非常复杂。
根据“请求-响应”模式的特点,大致可以分为客户端缓存和服务端缓存,因为服务端缓存经常和代理服务“混杂”,所以今天就来聊一聊客户端——即浏览器的缓存。

(Cache is an important concept in computer field and a tool to optimize system performance.Due to the long link and uncontrollable network delay, the cost of using HTTP to obtain resources is very high. Therefore, it is very necessary to cache the "hard won" data and reuse it as much as possible in the next request. This can avoid the communication cost of multiple request response, save network bandwidth and speed up the response speed.Imagine that if there are tens of K or even tens of M data, not from the network, but from the local disk, it will be a huge saving and avoid how much waiting time.In fact, each link of HTTP transmission basically has a cache, which is very complex.According to the characteristics of the "request response" mode, it can be roughly divided into client cache and server cache. Because the server cache is often "mixed" with the proxy service, let's talk about the client today, that is, the browser cache.)




页: [1]
查看完整版本: 生鲜速递:HTTP的缓存控制.pdf