Idea for a PR: Leverage HTTP libraries Caching with ETag and If-None-Match headers
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
In order to ease Consul integration with browers, I was wondering whether it would be a good idea to use ETag and If-None-Match HTTP Headers withing the HTTP Headers:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match
Since X-Consul-Index is already a kind of ETag, by addiing a kind of ETag to Consul, it would allow to leverage cache mechanisms of browser or HTTP libraries to perform polling using HTTP caches.
If each endpoint would issue a simple ETag header, the browser would then query the API with a If-None-Match and would get a HTTP 304 if the endpoint did not change (without returning the body).
Thus, the performance over HTTP would increase for GUIs using the Consul API and it would be more standard regarding the HTTP behavior. It would not modify the polling mechanism, but would help a lot creating well performing GUIs using HTTP Consul APIs.
I can perform a PR if you are interested with such change
Regards
Contributor guide
Assessment
This issue has not been assessed yet.