You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we can say it's a best practice to use SFV for headers, not JSON in any headers.
For avoiding developer using JSON or any other format, or SFV like format via hand-made-string-concat, Hono can natively support SFV encoder/decoder and guide developer to use it.
for example.
c.res.headers.append('Cache-Status','OriginCache; hit; ttl=1100, "CDN Company Here"; hit; ttl=545')
can be type gurded, by require SFList for value when key is Cache-Status.
It's very interesting, and your library seems very good. If we implement it, we will add the feature to c.header(). I'll try to investigate the SFV more. Thanks.
What do you think about implementing structured field values (SFV) following the RFC 8941 for our headers? It could streamline our communication, making it more standardized and efficient.
Some points to think about:
Standardization: Aligning with RFC 8941 ensures our headers adhere to established standards, improving interoperability
Efficiency: Structured field values keep data representation compact, reducing bandwidth usage
Clarity: The structured syntax enhances readability and simplifies debugging
However, there is a con. This may take a while because many programmers don't know SFV.
What is the feature you are proposing?
Structured Field Values is the standard spec for serialize structured object into http header value.
It already referrered by tons of newly defined http specs.
And also, IETF HTTP Working Group currently working on retrofit SFV with existing headers.
So we can say it's a best practice to use SFV for headers, not JSON in any headers.
For avoiding developer using JSON or any other format, or SFV like format via hand-made-string-concat, Hono can natively support SFV encoder/decoder and guide developer to use it.
for example.
can be type gurded, by require SFList for value when key is
Cache-Status
.FYI: I published typed SFV library to npm https://github.com/jxck/structured-field-values
Thanks.
The text was updated successfully, but these errors were encountered: