Node config: add feature flag for http cache headers
What
Adds a config argument for enabling http cache headers.
Why
Since this feature will add slight overhead, it should be opt-in.
Relative (head-n) queries are always changing which creates friction for integrating Octez RPCs with generic Caches as operators needs extra logic/heuristics to know when to invalidate such a response. To get around this, we introduce relevant HTTP Cache headers into the responses of Octez RPCs. The headers to be implemented are max-age
and ETag
with If-None-Modified
. This is an ongoing work with multiple MRs.
This: 1/n
Next: 2/n - !13296 (closed)
How
Update node config and cli
Manually testing the MR
λ /src/bin_node/octez-sandboxed-node.sh 1 --connections 0 --enable-http-cache-headers
...
May 17 14:41:08.592: HTTP cache headers enabled
...
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment,CHANGES.rst
at the root of the repository for everything else). -
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR
Edited by Ryan Tan