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

Response cache and matching lives in Fetch #79

Merged
merged 2 commits into from
Nov 30, 2016
Merged

Response cache and matching lives in Fetch #79

merged 2 commits into from
Nov 30, 2016

Conversation

igrigorik
Copy link
Member

Preload response's are one of several responses that interact with the
(yet to be formally defined) response cache. As such, the logic for both
populating and querying said cache should live in Fetch.

  • Updated issue text as a warning, with some context and pointer to the
    discussion in Fetch.
  • Removed "match a preloaded response" definition: this should be
    handled transparently by Fetch, as one of the first steps in its main
    fetch algorithm.

Fetch issue where we should continue this discussion:
whatwg/fetch#354

Closes #30.

Preload response's are one of several responses that interact with the
(yet to be formally defined) response cache. As such, the logic for both
populating and querying said cache should live in Fetch.

- Updated issue text as a warning, with some context and pointer to the
  discussion in Fetch.
- Removed "match a preloaded response" definition: this should be
  handled transparently by Fetch, as one of the first steps in its main
  fetch algorithm.

Fetch issue where we should continue this discussion:
whatwg/fetch#354

Closes #30.
In effect, the preload cache is a UA maintained response cache with a
few interesting lifetime + eviction quirks.</p>
<li>Add request to fetch group's response cache.
<div class="advisement">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we indicate that this is non-normative, or is the advisement class enough?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should.. I'll change the class to note and change up the verbs.

retained by the user agent and executed by the application when matched
with a request initiated by the application. As such, from an application
perspective, there is no difference between consuming a preload or a
server push response.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not entirely true. There's no difference between consuming an explicit preload (link preload based) and an implicit one (triggered by preloadScanner). There is a difference with H2 push though - consuming H2 push involves marking an RT entry, going through SW, and querying the HTTP cache before the H2 push response is matches with the request at the net stack layer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, for Blink's implementation today.. and there is ongoing discussion(s) as to whether that should remain as is - e.g. if we actually trigger push events in JS land, then all this will obviously have to change.

For an application, both paths will trigger SW lookup, HTTP cache lookup, etc. Yes, there is difference in when those things happen, but that's mostly due to internal (unspecified) implementation bits. As such, I'm inclined to keep this as is.. at least until we all converge on some standardized treatment of h2 push in our specs.

@yoavweiss
Copy link
Contributor

Overall LGTM. Added a couple of comments

@igrigorik igrigorik merged commit 0a9a93d into gh-pages Nov 30, 2016
@yoavweiss yoavweiss deleted the caches branch February 3, 2021 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants