WICG / nav-speculation

Proposal to enable privacy-enhanced preloading
https://wicg.github.io/nav-speculation/
Other
152 stars 35 forks source link

Should the spec be explicit about deduplicating prefetches/prerenders? #315

Open kjmcnee opened 4 months ago

kjmcnee commented 4 months ago

Spinning off discussion in https://github.com/WICG/nav-speculation/pull/310#discussion_r1575338094

In the chromium implementation, we currently dedupe prefetches and prerenders based on the exact URL. That is, if we have an existing prefetch/prerender to a given URL, we don't start another request to the same URL.

In the prefetch spec, we don't explicitly mention deduplication. In the prerender spec, we explicitly dedupe based on an exact URL match. In either case, the steps are optional, so there's presumably an implicit option for the UA to dedupe.

If we do want to be explicit in the spec about deduplication, should this also incorporate No-Vary-Search?

Options here could be:

  1. Remove the explicit deduplication from this prerender spec
  2. Add explicit deduplication based on exact matches to the prefetch spec
  3. Add explicit deduplication based on NVS matches to the prefetch and prerender specs and update the chromium implementation
  4. Add explicit deduplication based on exact matches to the prefetch spec and add explicitly optional NVS based deduplication to prefetch and prerender specs
domenic commented 4 months ago

I am in favor of option 3, unless there is some subtle problem there I am not realizing.

kjmcnee commented 4 months ago

Option 3 sounds like everyone's preferred option.

It would also allow us to simplify the matching logic to not need to deal with multiple potential matches.