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

Group endpoints by origin #67

Merged
merged 1 commit into from
Feb 12, 2018
Merged

Group endpoints by origin #67

merged 1 commit into from
Feb 12, 2018

Conversation

dcreager
Copy link
Member

@dcreager dcreager commented Jan 5, 2018

This is a pretty big change. It changes the reporting cache so that there's a single "client" entry for each origin. That client contains a list of "endpoint groups", each of which contains a list of "endpoints". These are the same objects as before, just organized differently.

More importantly, this also changes the format of the JSON array in the Report-To header:

  • Each element in the array now describes an endpoint group, not an individual endpoint.

  • The max-age and include-subdomains properties now belong to endpoint groups, and not to individual endpoints.


Preview | Diff

@dcreager
Copy link
Member Author

dcreager commented Jan 5, 2018

This should cover #24, #48, #64, and #66. (And maybe #14?)

@dcreager
Copy link
Member Author

dcreager commented Jan 5, 2018

/cc @juliatuttle @igrigorik

@dcreager dcreager mentioned this pull request Jan 12, 2018
Copy link
Member

@igrigorik igrigorik left a comment

Choose a reason for hiding this comment

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

Overall, looks good! My only question, before we merge this, is to sanity check that we're OK with the change to TTL behavior — see comment in review.

index.src.html Outdated
Each <a>client</a> has an
<dfn for="client" export attribute>endpoint-groups</dfn> list, which is a list
of <a>endpoint groups</a>, each of which MUST have a distinct
{{endpoint group/name}}.
Copy link
Member

Choose a reason for hiding this comment

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

What happens when you have a name collision? We should define what the UA should do here: first wins, last wins, abort the header, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

The parsing algorithm already mandated "keep first", but I added a sentence here reinforcing that.

<dfn for="endpoint group" export attribute>subdomains</dfn> flag, which is
either "`include`" or "`exclude`".

Each <a>endpoint group</a> has a
Copy link
Member

Choose a reason for hiding this comment

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

Previously you could have different TTLs for each endpoint, this changes this to a group-wide TTL. Are we OK with that? Would you ever want to have different endpoints with different TTLs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think it makes more sense for the TTL to be per-group. I've view the TTL as describing how long the entire configuration is valid, not how long we expect any individual endpoint to be up. The delivery mechanism will gracefully handle if a dodgy endpoint goes down, and new header values always overwrite old ones, even if a TTL hasn't expired, so there's no worry about stale data persisting for too long.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. LGTM to merge from this end.

This is a pretty big change.  It changes the reporting cache so that
there's a single "client" entry for each origin.  That client contains a
list of "endpoint groups", each of which contains a list of "endpoints".
These are the same objects as before, just organized differently.

More importantly, this also changes the format of the JSON array in the
`Report-To` header:

  - Each element in the array now describes an endpoint group, not an
    individual endpoint.

  - The `max-age` and `include-subdomains` properties now belong to
    endpoint groups, and not to individual endpoints.
@igrigorik
Copy link
Member

Based on discussion on last WebPerf WG call: looks good, merging.

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

Successfully merging this pull request may close these issues.

2 participants