38 ms·
The ETag can be _anything_. I have an API that serves "files" from a backend storage system. Whenever files are written a revision number is incremented. Thi
by akira2501 3y ago
The ETag can be _anything_. I have an API that serves "files" from a backend storage system. Whenever files are written a revision number is incremented. This is perfect for a weak validator and so my ETags are also blisfully short and semantically useful, typically:
ETag: W/"750"
This also means the API can just check the revision number and avoid pulling out and decompressing some of the larger payloads that are stored there and the implementation is absolutely minimal. It's a great standard.
- kevincox 3y agoCan't it be a strong validator if the files don't change at all between revisions? Or does the revision number only increment on "significant" revisions?
- akira2501 3y agoThe data does not but certain metadata elements might. It probably could be a strong validator anyways for it's use cases, but I made the decision in a hurry.
- choppaface 3y agoA great standard but also provides an effective cookie-less mechanism for user tracking e.g. https://levelup.gitconnected.com/no-cookies-no-problem-using-etags-for-user-tracking-3e745544176b https://levelup.gitconnected.com/no-cookies-no-problem-using...
- LtWorf 3y agoThat's why tracking requires consent, regardless of the specific hack used to do it.