4 ms·
I made some comments over in the "chrome version" of this thread: https://news.ycombinator.com/item?id=13492483 https://news.ycombinator.com/item?id=13492483 I
by benjaminjackman 10y ago
I made some comments over in the "chrome version" of this thread: https://news.ycombinator.com/item?id=13492483 https://news.ycombinator.com/item?id=13492483
I agree with you that HTTP headers feel like a hack for most use cases. It would be nice to embrace the best practice of content-based addressing as an official standard rather than as an adhoc hack on top of query parameters (or whatever approach is taken).
The url itself ought to convey:
1. if it's immutable
2. if possible, provide hash-based address of its content, in addition to a particular url that provides that content. (that url should eventually come to be viewed as a fallback location, the content should primarily come to be obtained by its hash).
I agree and don't feel like relying on http headers is the right way to convey that a particular url is in fact immutable. It feels like that that generally belongs with the url itself not in the response to it, (for static resources atleast).
Think about programming if a function was immutable, or pure, we'd mark it as such in it's type signature (e.g. @pure), where we have language support, not as additional thing it we got in the basket of crap we got after we executed it.
For dynamic restful API type services (an image resize service was an example), the url still ought to be marked immutable in some fashion, but the actual hash won't be known until the function is executed once. This seems like a function memoization type problem so in that case the content hash will have to be passed along with the result.
Anyhow, It would be really nice to:
1. Have these features (@pure &| content-hash = abc123) in urls usable today so that they are backwards compatible, e.g. fail right into the fallback address for all the older devices of the world.
2. Are standardized and universally intelligible and not adhoc as the approaches to content-based addressing are today, so that eventually we can get first class support for loading resources just by their hashes from the browsers themselves.
- dotancohen 10y ago> Think about programming if a function was immutable, or > pure, we'd mark it as such in it's type signature Actually, MySQL has something similar. Stored Functions can be marked as [NOT] DETERMINISTIC, to indicate that they will always return the same value given the same input. https://dev.mysql.com/doc/refman/5.7/en/create-procedure.html https://dev.mysql.com/doc/refman/5.7/en/create-procedure.htm...