-
Notifications
You must be signed in to change notification settings - Fork 31
Can the browser place limits on the preload cache? #121
Comments
You're right that this needs to be defined as part of #97, but generally, I don't view preloads as inherently different from regular resource fetches (which aren't currently limited and in some browsers, the resources are kept in memory as long as the resource is referenced). Do you see a need to place such artificial limits on preloads, that don't apply to other resources? |
I think the difference in my mind is that the preload cache is speculative to a degree. Its possible a site could preload things and never use them. How long must the browser hold on to that memory? How large must the browser allow that memory usage to grow? It seems like providing some mechanism for browsers to discard preload data due to time thresholds or memory pressure would be nice. |
OK, I think that adding some prose permitting browsers to drop preloads from the cache after some reasonable timeout makes sense. |
I'm concerned about adding timeouts, depending on the values and the implementation. We're starting to use preload with a lot of success at Facebook to schedule the download of JS while not blocking the main thread to parse at an uncontrollable time when the download finishes. In many cases we're doing this after the DOM onload event for interaction boundaries and since it's user initiated there no clear timeout to use. With a timeout sites would have a strong incentive to turn the preload-ed JS resources into loaded JS resource before the timeout is encountered which would consume more resources. I think encouraging this is strictly worse. |
@wanderview - Is this still relevant now that we have a more rigorous definition of the preload cache? /cc @noamr |
Yea IMO we shouldn't limit the preload cache the same way we don't limit the number of DOM nodes or their associated resources. |
This is related to #97, but maybe worth asking as a separate question.
Can the browser place limits on how large the preload cache can grow?
I believe in webkit/chromium this cache is implemented as part of the renderer process memory cache. What do these browsers do if you try to preload an exceptionally large amount of data? Does it just keep filling RAM until OOM? Or do they spill to disk? Or do they just stop implementing the preload behavior if the cache hits some threshold?
The text was updated successfully, but these errors were encountered: