Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why some css, js and images files are loaded from the disk cache and other no?

I'm running WP website with cache plugin enabled. The site is running slow so I decided to check which element is consuming more time to load. Straight to F12 (chrome web tools) and from there the tab Network. What I see and I don't understand is why some of the files are loading from disk cache and other no. Please see the attached image (column "Size")

web tools screenshot

So, if you know the answer guys, please share it.

Thank you!

like image 736
Tzvetan Jordanov Avatar asked Jan 20 '20 15:01

Tzvetan Jordanov


1 Answers

Memory Cache- stores and loads resources from Random Access Memory (RAM). It is fast because it is easy to load resources from RAM. These resources will persist until you close the Browser or you manually clear it.

Disk Cache- It stores and load the resources from disk and it is persistent. It will not contact webserver over network to get the data.Disk cache is usually included as part of the hard disk.

I guess browser will decide the type of cache storage based on the type of the resources or based on their frequency of usage.

Sometimes we use assets or resources from other sites(third party) these contents will be transferred over the network and size of those contents will be donated in Bytes(B).

like image 141
Amaresh S M Avatar answered Jan 03 '23 01:01

Amaresh S M