4

Let me take the worst scenario of browser resource caching

I have configured a static resource(with big size) to be cached for long expire (say 1 yr) with the version, so it's get downloaded with each version update. Let's assume I have updated 500+ version of it within a year. does it work without any error?

  1. Does browser keep all version in cache? (Obvious if not expired)
  2. What is the maximum size of cache browser can store?
  3. Is there any cache eviction strategy to invalid/remove not used cache?
piet.t
  • 11,718
  • 21
  • 43
  • 52
HybrisHelp
  • 5,518
  • 2
  • 27
  • 65
  • 1
    1. not guaranteed. 2. chrome://net-internals/#httpCache ("Max size") 3. https://www.chromium.org/developers/design-documents/network-stack/disk-cache#TOC-Eviction – Kaiido Nov 13 '17 at 04:43
  • Does It means above-mentioned scenario will work as expected without any error? – HybrisHelp Nov 13 '17 at 04:47
  • 1
    Well if there is no bug in chrome's behavior, yes it should work without any error. Previous versions will soon be marked as *low reuse* and eventually as *not reuse*, and will get kicked off when needed, even if their expire has not passed yet. – Kaiido Nov 13 '17 at 04:50
  • This is colliding with my (short) knowledge of cache policy: in Ruby on Rails static assets are finger printed, which means the name of the asset is followed by a number of random characters. So when you update a specific asset, the name will change too, letting the browser know which to use. The above thread and comments suggest the newest asset will be used and old asset won't be used and eventually deleted. – Maxence Aug 04 '20 at 09:37
  • This link for example explains it : https://tomanistor.com/blog/cache-bust-that-asset/#:~:text=Fingerprinting%20static%20assets%20is%20adding,download%20and%20serve%20the%20asset.&text=So%20in%20short%2C%20the%20cache,to%20distinguish%20between%20different%20versions. cc @HybrisHelp – Maxence Aug 04 '20 at 09:38

0 Answers0