Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Can the browser place limits on the preload cache? #121

Open
wanderview opened this issue Feb 12, 2018 · 6 comments
Open

Can the browser place limits on the preload cache? #121

wanderview opened this issue Feb 12, 2018 · 6 comments
Labels

Comments

@wanderview
Copy link
Member

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?

@yoavweiss
Copy link
Contributor

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?

@wanderview
Copy link
Member Author

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.

@yoavweiss
Copy link
Contributor

OK, I think that adding some prose permitting browsers to drop preloads from the cache after some reasonable timeout makes sense.

@yoavweiss yoavweiss changed the title can the browser place limits on the preload cache? Can the browser place limits on the preload cache? Oct 17, 2018
@bgirard
Copy link

bgirard commented Oct 25, 2018

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.

@yoavweiss yoavweiss added Preload and removed prose labels May 4, 2022
@yoavweiss
Copy link
Contributor

@wanderview - Is this still relevant now that we have a more rigorous definition of the preload cache?

/cc @noamr

@noamr
Copy link
Contributor

noamr commented May 4, 2022

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants