Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate requests in a Background Fetch #129

Open
rayankans opened this issue Nov 14, 2018 · 3 comments
Open

Duplicate requests in a Background Fetch #129

rayankans opened this issue Nov 14, 2018 · 3 comments

Comments

@rayankans
Copy link
Contributor

The spec defines outlines the matching algorithm here: https://w3c.github.io/ServiceWorker/#request-matches-cached-item

A Background Fetch should have the same set of restrictions (duplicate URLs allowed only with an appropriate Vary header).

@mugdhalakhani
Copy link

Just summarizing the points I made over email:

  1. Our implementation will get simpler indeed without having to deal with duplicate requests, and you're right about the inconsistencies with the cache storage API. Cache API doesn't support requests with bodies either, but we plan to support them.
  2. For uploads, developers will want to use the same URL for all requests in the fetch.
    If we decide to not to support these, developers will need to add some (unnecessary) query params to each upload URL, to get past our check. This feels non-ideal, and might be seen as a limitation of our implementation.

@rayankans
Copy link
Contributor Author

  • This discussion is on the spec level so the implementation is irrelevant.
  • It's true that the cache API doesn't support requests with bodies, but I'm referring to the match/matchAll algorithm, which is being applied to both with a different set of preconditions.
  • It is only a limitation in so far no duplicates are allowed in a cache.

@mugdhalakhani
Copy link

  • I agree the implementation is irrelevant, all the more reason to support Duplicate requests.
  • I mentioned requests with bodies because that's they'll Duplicate requests, and we plan to support them.
  • We should explore ways to support duplicate requests in a cache then.

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

No branches or pull requests

2 participants