Replies: 2 comments 1 reply
-
There is an a lot to go through in your post. I don't know if I'll be able to answer it all (or want to) but here are some comments. https://developer.mozilla.org/en-US/docs/Glossary/Fetch_metadata_request_header This will have appeared somewhere like this:
This is just a combo of an "Functional grouping" category "Fetch metadata" and the "request header" metadata group. It could have been.
To be consistent we might rename to [fetch metadata headers] as an "Functional group" like client hints.
As above, I see this as an functional grouping that is no more special than any other. YOu'll see it linked mostly like this (which is IMO a good pattern - we should just adopt the same pattern everywhere).
Hmmm. Yes, the information is duplicated. You could argue that the Header Type could be omitted here, though not sure if it harms. Perhaps we should just have these groupings in the table.
It is intended that users should know the context in which they expect to see a header - a request or a response, or both. It is also helpful when authoring to know this, because it reminds you to cover the use in both cases. IMO it is largely irrelevant to most readers whether something is a representation (or entity header) or a content header. But it is a useful as a "functional group" for those headers. The request/response should be listed too. For the fetch and client hint cases, yes, they should be request/response and the functional category. If not, then the request/response is missing or implied by the group name (for fetch metadata).
I think so. Perhaps the reasoning or omissions are now more explicit.
Agreed. I think generally they are. The exceptions are things like Content and Representation, which have an annoying specification overlap. They are also really mostly useful as a functional group the related headers so they aren't floating around in "no group", with no explanation of what they are for.
Yes. Naively I would have thought so, but our docs do not agree:
Omissions. See my point 1. I suspect that this may have been intentional originally, but now is an omission.
I think the above does not reflect the way the specs read now, and should be removed.
OK, we should fix these up to match the spec. It may be that the headers/validator make sense - i..e that the spec doe list validators as representation headers. They are conceptually different but the spec does overlap. The content headers are fairly clear. These allow you to restore your message or messages from whatever encoding was used to transmit it/them. A representation is essentially a particular form of the data - such as an XML file or a JSON file, perhaps in a particular language. So you can request "a listing of all the different types of bees", and use these headers to get the form of the data you received - pdf, xml listing, french language version - or of course you can specify what you want and get the specific version that is useful for you from the "generic" endpoint. The representation might also include the encoding I understand - for example, its a zipped XML.
Yes. Functional groups. See also other categories in https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers
I think we should do the intro "XXX response header that is a network client hint"
IMO the representation header is find to include just for those headers that are of the kind. Its a functional group.
If we're ever going to mention/link to these things then having a document which explains them seems sensible to me. Though I guess we have other cases where we just list related headers. If only the group is useful, then I guess so.
As above.
As above. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks a lot, Will.
I think it's useful to know if something is a req/resp header first and foremost, for other types, some thoughts below:
For the intro sentence, I would keep 'whether a header is a request header, a response header, or both', and add that where we omit it. One thing to consider is that showing when something is a representation header can help understand the purpose or how you can use it. For instance,
Sounds good to me.
I'm +1 on this, given the content header glossary page landed in mdn/content#35335, which you can see fell mostly out of recent HTTP revisions dropping "payload" terminology. IMO "payload header" is a lot more descriptive, and tells you about how something is delivered.
Also sounds good.
In this case, there's an article on the topic, and each of the relevant headers are listed there. This is different, IMO, because there's a mechanism or feature you want to use and those are the headers to look at / use, whereas repr/content headers help understand protocol semantics. I think we all agree at least that the intro sentence and the table should say if something appears in requests, responses, or both. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is related to mdn/content#39902.
The HTTP documentation includes various categorizations of headers, which are currently glossary entries. I'm going to omit the "forbidden" and "CORS safelisted" categories, because I think they're unproblematic. That leaves:
https://developer.mozilla.org/en-US/docs/Glossary/Request_header
https://developer.mozilla.org/en-US/docs/Glossary/Response_header
https://developer.mozilla.org/en-US/docs/Glossary/Representation_header
https://developer.mozilla.org/en-US/docs/Glossary/Content_header
https://developer.mozilla.org/en-US/docs/Glossary/Fetch_metadata_request_header
https://developer.mozilla.org/en-US/docs/Glossary/General_header (obsolete)
https://developer.mozilla.org/en-US/docs/Glossary/Entity_header (obsolete)
We also have "client hints", which doesn't have a glossary entry but appears in similar contexts to these.
As far as I know the main place this is surfaced is in the "Header type" row in the table in each reference page:
It's also used in the preamble sentence in the page:
I'd like to understand better which categories we expose here, and which we should expose.
What we do now
I went through all the header pages, and noted what we say for "header type": https://docs.google.com/spreadsheets/d/1llnxSjB9fu4TEMx5VrGOJFqh2PgIx7Wn_u5lD6DhCKU/edit?usp=sharing.
We can see a few things:
Is this correct? For example, is it meaningful that some headers are representation headers only, and some are representation headers and request/response headers?
Is it helpful? Is the taxonomy we're exposing here useful to developers?
I think that to be helpful, a categorization should:
Request and Response headers
These seem pretty clear. Even I understand that some headers are request headers, some are response headers, and some can be both. But should every header fall into one of these categories? Naively I would have thought so, but our docs do not agree:
Content-Typeis listed only as a representation header, both in the table and in the intro sentenceRepr-Digestis listed only as a representation header in the table, but as a request/response header in the intro sentence.The glossary pages for request and response headers do touch on this:
Is this a helpful distinction for our docs to make? Is it the case that some representation headers are also request/response headers, and some aren't? If so (and if our current docs are correct, it is), where in the spec is this indicated?
Representation headers
These are described in the glossary page. But for me at least it's quite hard to use this quite abstract definition to know whether a particular header is a representation header or not (and if it is only a representation header and not also a request/response header, or even whether that is a meaningful distinction).
It's also not clear from this page exactly which headers are representation headers. It has weasel words like:
and
Section 8 of the spec talks about "representation metadata" but the headers listed there don't match up exactly with the list in the glossary page or the headers whose reference page calls them representation headers: for example,
Content-Rangeis listed in the glossary page but not under section 8, andRepr-Digestis described in its reference page as a representation header, but is not in section 8.What's the real answer here? Is any of this really useful to developers?
Content headers
These are also described in quite abstract terms in their glossary page. The description implies that they are different from representation headers:
...but also that:
...and again it's not clear which headers exactly should live in this group, or what a developer is supposed to make of this information. The spec doesn't even describe this category any more.
Again, there is a list with weasel words:
...but several of the items listed are not marked as content headers in the reference pages for those headers (e.g.
Content-Encoding)The glossary page is quite new actually, and I see @bsmth had this comment in the PR where it was added:
...which makes me feel a bit better about the situation :).
Client hints
These seem like a more straightforward category. The set of client hint headers is clearly defined and we can see how a developer would want to consider them as a coherent part of HTTP. There's what seems like a good guide outlining them and it's surely worth consistently linking to it from the client-hint headers, and doing that in "header type" seems like a good approach.
Fetch metadata
Same goes for fetch metadata. The main difference between this group and client hints is that we don't have a standalone guide to fetch metadata, but we probably should.
Tentative proposal
So given all that, here's my tentative proposal.
in the "header type" row in header reference pages, and the intro sentence, we note:
we keep something describing representation headers, although not as a glossary page, per Lists in forbidden req/resp header glossary entries should be in HTTP section content#39902.
we remove the glossary page on content headers.
eventually, we write a proper guide page on fetch metadata.
Should we also expose conditional headers?
Beta Was this translation helpful? Give feedback.
All reactions