Skip to content

add cache handlers for individual items (blocks, microblocks, principals) #1230

Closed

Description

We currently have two cache handlers that we use to create ETags for most of our endpoints:

  1. Chain tip: Latest block/microblock hash
  2. Mempool: Hash digest of all non-pruned mempool tx_ids

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

Metadata

Assignees

Type

No type

Projects

  • Status

    ✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions