-
Notifications
You must be signed in to change notification settings - Fork 2
Header names #34
Comments
I believe the big selling point is the widespread use of those names already. |
Using the same header names will cause problems unless there's already very good interop across different implementations, and we don't change anything. |
From what I can see the current draft is compatible with some implementations out there. Obviously not all of them. But proposing yet another set of headers would just create this situation, wouldn't it: https://xkcd.com/927/? |
If you want to take a cynical view, sure. The other uses aren't standard, however; they're one-off, site-specific semantics. Regardless, this is something we can discuss if the draft is adopted. |
Fair enough. Do you have any names in mind? |
Agree. The semantic now is core.
Yes, that was the purpose of the intro. See #15. |
It's uncommon to have concatenated words without a hyphen in HTTP headers. e.g. That being said, I actually agree, if there is legacy usage, using the same name could be risky, and maybe it's better just to have a clean cut. The key point would be... maybe acknowledging existing usage so that it's clear what's going on to those implementing the standard. Regarding headers, I'd carefully consider mutabilty w.r.t. hpack. If there are fields that change infrequently, don't bundle them with fields that change every other request. Because HPACK will compress those unchanging fields down to 1-2 bytes. Additionally, on the server, it's nice to be able to tell HPACK to ignore some fields that we know would be changing every request, because that way it won't get added to the dynamic dictionary and take up useful space. So, I don't know specifically how it should be structured, but I can think of at least one way:
Regarding how to name this, I guess the first step would be looking at existing standardised headers. Finally, one additional detail which might be useful, if it's possible just to have one header... you can still send dynamic data by splitting it into multiple headers.
You could potentially look at how the new |
Thanks @ioquatix for your detailed analysis! hyphens and single-header
I'd see
we thought about it, but I strongly agree with @whiskeysierra #34 (comment) hpack & performance
good catch, but iiuc hpack's benefits mostly for ingress traffic
That's interesting: can you PR a FAQ on that? @ioquatix
Only the server knows whether the RateLimit headers are static or not: see this example.
We avoided mentioning |
Compatibility with existing headers is useful but I don't think it's a necessity, especially if you can make a big reduction in overhead. Regarding HPACK, it applies to both request and response headers equally. Here is an example regarding the compression strategy: #!/usr/bin/env ruby
require 'protocol/hpack'
def current_proposal
buffer = String.new.b
compressor = Protocol::HPACK::Compressor.new(buffer)
10.times do |i|
compressor.encode([
["RateLimit-Limit", "10, 10;w=1, 50;w=60, 1000;w=3600, 5000;w=86400"],
["RateLimit-Remaining", "#{60 - i}"],
["RateLimit-Reset", "#{60 - i}"],
])
puts "Cumulative total after #{i+1} request(s): #{buffer.bytesize}B"
end
puts "Dynamic table: #{compressor.context.current_table_size}B, #{buffer.bytesize}B across the wire."
end
def another_option
buffer = String.new.b
compressor = Protocol::HPACK::Compressor.new(buffer)
10.times do |i|
compressor.encode([
["Rate-Quota", "10, 10;w=1, 50;w=60, 1000;w=3600, 5000;w=86400"],
["Rate-Limit", "#{60 - i}/#{60 - i}"]
])
puts "Cumulative total after #{i+1} request(s): #{buffer.bytesize}B"
end
puts "Dynamic table: #{compressor.context.current_table_size}B, #{buffer.bytesize}B across the wire."
end
current_proposal
another_option Output:
|
True, see the gain gap between requests and response though https://blog.cloudflare.com/hpack-the-silent-killer-feature-of-http-2/ |
Great article, but that is relating to general requests/responses not specifically how headers are compressed or decompressed - it doesn't make any difference if it's request or response, the exact same logic is applied. |
Address some faq for header names. See #34
I was just thinking there is at least one example where the adopted headers didn't match the unofficial headers: https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/ So, there is at least a precedent for choosing better names than what has been the defacto standard. I personally believe that there is a balance, but for me it's slightly in favour of the almost unlimited code that has yet to be written, rather than the legacy systems which will mostly be discarded. |
Also, regarding the FAQ entry, I don't think I was advocating for a single header - it's fine to have one header for static content and one header for dynamic content, e.g. as proposed |
Before writing the draft I considered the single-header stuff we thought too when first dealing with the subject (), so I thought it was worth mentioning it in the FAQ :)
I know, and one of the open issues we have in the Italian API guidelines is the following:
As of now - even if we would enforce In this case, which is much simpler that |
I wouldn't spend too much time on the header name right now, if your intent is to take it to the WG. |
Since last year, we have now various implementers (see #1); changing field names will be impractical now. |
That argument may not carry much weight once you get it into a WG. I'd suggest getting it there soon if you have implementations... |
@mnot tomorrow we'll present the draft to the new httpapi-wg: we hope to call for adoption :) Reopening as requested. |
RateLimit-Limit
is not a great name... suggest making them more concise.The text was updated successfully, but these errors were encountered: