当前位置:网站首页>200 OK (from memory cache) and 200 OK (from disk cache)
200 OK (from memory cache) and 200 OK (from disk cache)
2022-06-25 19:46:00 【* listen to the wind】

200 OK(from memory cache) Memory cache
No access to the server , Read cache directly from memory .
At this time, the obtained data is cached in memory , When kill After the process ( Browser closed ), The data will not exist ( Resources have been released ).
If you open the page again , There will be no 200 OK(from memory cache).
characteristic
- Memory cache capacity is small
- Fast read : The memory cache will compile the parsed file , Directly into the memory of the process , Occupy a certain memory resource of the process , In order to facilitate the next run-time use of fast reading
- timeliness : Very short cache timeliness , Will be released as the process is released
200 OK(from disk cache) Hard disk cache
No access to the server , Read cache directly from disk , When kill After the process ( Close the browser ), The data still exist .
The next time you open the page, it's still from disk cache.
principle
The hard disk cache directly writes the cache to the hard disk file , To read the cache, the hard disk file stored in the cache should be I/O operation , Then re parse the cache content , Read complex , Slower than memory cache .
Capacity
Large hard disk cache capacity
304 Not Modified
Access server , Found that the data is not updated , The server returns this status code . then , Read data from cache .
Comparison of several States
| state | type | explain |
|---|---|---|
| 200 | form memory cache | Do not request network resources , The resource is in memory , General script 、 typeface 、 The picture will be stored in memory |
| 200 | form disk ceche | Do not request network resources , In the disk , Generally, non scripts are stored on the disk , Such as css etc. |
| 200 | Resource size value | Download the latest resources from the server |
| 304 | Message size | The requesting server found that the resource was not updated , Using local resources |
Style sheets are usually on disk , It won't be cached in memory , because CSS Style loading once can render the web page . however , The script may be executed at any time , If the script is on disk , To execute this script, you need to get it from disk to memory . such IO It costs a lot , May cause the browser to lose response . therefore , Scripts are usually in memory .
For large files , The high probability is not stored in memory , Whereas the priority . Current system memory usage is high , Files are stored in the hard disk first .
In the browser , The browser will be in js And pictures and other files are directly stored in memory cache after parsing , When refreshing the page, you only need to read it directly from the memory cache (from memory cache); and css The file will be stored in the hard disk file , So every time you render a page, you need to read the cache from the hard disk (from disk cache).
Three level cache principle
Look for memory first , If there is , Load directly from memory
If there is no memory , Then go to the hard disk for , If there is a direct load
If there's no hard disk , Then make a network request
The loaded resources are cached to the hard disk and memory
The browser runtime is coordinated by several processes , So the operating system to save memory , Will exchange a part of the memory resources back to the disk swap area , Of course, the exchange is strategic , For example, the most commonly used one is LRU. So when the cache resource does not expire , If the resource is in memory, then from memory, If only on disk from disk.
Example :
Load a picture resource sequence :
visit -> 200 -> Exit browser
Once again into the -> 200(from disk cache) -> Refresh -> 200(from memory cache)
prohibit 200 Caching method
prohibit 200 OK (from disk cache) The cache method is ,ajax The request is to take parameters cache: false.
边栏推荐
- 六、HikariConfig的配置解析
- Guangzhou Sinovel interactive creates VR Exhibition Hall panoramic online virtual exhibition hall
- Ali visual AI training camp -day03- construction of electronic photo album (face and expression recognition)
- Automatic fitting when the applet reaches the top
- Kotlin compose terminate todo project Click to edit and modify todo
- 五、HikariCP源码分析之初始化分析二
- QQ机器人官方插件加载配置方法【beta2版本】
- ActiveMQ--CVE-2016-3088
- Idea common plug-ins
- Do you want to know how new investors open accounts? Is online account opening safe?
猜你喜欢

Vulnhub range - darkhole 1
![[today in history] June 25: the father of notebook was born; Windows 98 release; First commercial use of generic product code](/img/ef/a26127284fe57ac049a4313d89cf97.png)
[today in history] June 25: the father of notebook was born; Windows 98 release; First commercial use of generic product code

Ali visual AI training camp -day03- construction of electronic photo album (face and expression recognition)

Vulnhub range the planes:earth

Principles of MySQL clustered index and non clustered index

Cutting feet to fit shoes - talking about the ramp reconstruction on the track

Determine whether it is a web page opened on wechat

Applet password input box

QQ机器人疫情查询/疫情关注等【最新beta2版本】

Guangzhou Sinovel interactive creates VR Exhibition Hall panoramic online virtual exhibition hall
随机推荐
JS get data
PostgreSQL division considerations
Ali visual AI training camp -day05- creativity day - your image recognition project
JVM | runtime data area (heap space)
JS mobile phone and computer open different websites
R language uses the model of DALEX package_ The profile function interprets the relationship between a continuous feature and the target value Y in multiple classification models based on the conditio
Uncover ges super large scale graph computing engine hyg: Graph Segmentation
Tcp/ip test questions (II)
Redis cache preheating & avalanche & breakdown & penetration
DARKHOLE 2
1、 Hikaricp source code analysis of connection acquisition process I
Vscode debugging PHP configuration Xdebug
Applet password input box
Print 1 cute every 100 milliseconds ~ with a running lantern effect
Randomly generate 100 non repeating numbers between 1 and 150 and put them in the array
What should I pay attention to in GoogleSEO content station optimization?
Applet request interface encapsulation
What are Baidu collection skills? 2022 Baidu article collection skills
Solidity get quarterly time
QQ robot flash forwarding / recall message forwarding [latest beta2 version]