RESOLVED FIXED Bug 197736
Limit number of prefetches of a given page
https://bugs.webkit.org/show_bug.cgi?id=197736
Summary Limit number of prefetches of a given page
Rob Buis
Reported 2019-05-09 05:39:25 PDT
For now a first approach is to just allow one unique url.
Attachments
Patch (3.37 KB, patch)
2019-05-09 05:50 PDT, Rob Buis
no flags
Patch (3.37 KB, patch)
2019-05-09 06:49 PDT, Rob Buis
no flags
Patch (1.77 KB, patch)
2019-05-09 11:33 PDT, Rob Buis
no flags
Rob Buis
Comment 1 2019-05-09 05:50:01 PDT
Rob Buis
Comment 2 2019-05-09 06:49:27 PDT
Darin Adler
Comment 3 2019-05-09 10:25:38 PDT
Comment on attachment 369489 [details] Patch It’s unnecessary to design this so that it requires two separate functions in PrefetchCache and extra hash table lookups. Instead we could simply implement this policy in the prefetch cache itself. We would use add instead of set inside PrefetchCache::store, check the return value and return early if there’s already a prefetch for the URL. Currently, the single caller doesn’t even need to know whether the prefetch was done or not so we wouldn’t have to change anything outside that function.
Rob Buis
Comment 4 2019-05-09 11:33:50 PDT
Rob Buis
Comment 5 2019-05-09 11:36:03 PDT
(In reply to Darin Adler from comment #3) > It’s unnecessary to design this so that it requires two separate functions > in PrefetchCache and extra hash table lookups. Instead we could simply > implement this policy in the prefetch cache itself. We would use add instead > of set inside PrefetchCache::store, check the return value and return early > if there’s already a prefetch for the URL. Currently, the single caller > doesn’t even need to know whether the prefetch was done or not so we > wouldn’t have to change anything outside that function. Much better, thanks! I updated the patch.
WebKit Commit Bot
Comment 6 2019-05-09 23:44:19 PDT
Comment on attachment 369500 [details] Patch Clearing flags on attachment: 369500 Committed r245171: <https://trac.webkit.org/changeset/245171>
WebKit Commit Bot
Comment 7 2019-05-09 23:44:21 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 8 2019-05-09 23:45:18 PDT
Note You need to log in before you can comment on or make changes to this bug.