Closed
Description
openedon Jul 7, 2022
We currently have two cache handlers that we use to create ETags for most of our endpoints:
- Chain tip: Latest block/microblock hash
- Mempool: Hash digest of all non-pruned mempool
tx_id
s
While these work great for endpoints which depend on global chain or mempool status like /extended/v1/blocks
or /extended/v1/tx/mempool
, they can incorrectly return a cache miss for others that are concerned with individual items. Some examples:
/extended/v1/blocks/:block_hash
would be a cache miss when the chain advances, even though the individual block would not have changed at all/extended/v1/tx/:tx_id
similar (but already being fixed in feat: add cache control to/extended/v1/tx/:tx_id
#1229)/extended/v1/address/:principal/transactions
would be a cache miss even though that principal did not receive or send any new transactions/extended/v1/address/:principal/balances
same as above- etc...
We should create an individual item cache handlers for each of these (and more) use cases so we can maximize our number of cached responses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment