Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rafaelcr opened this issue Jul 7, 2022 · 4 comments · Fixed by #2103
Closed

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

rafaelcr opened this issue Jul 7, 2022 · 4 comments · Fixed by #2103

Comments

@rafaelcr
Copy link
Collaborator

rafaelcr commented Jul 7, 2022

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

@rafaelcr rafaelcr self-assigned this Jul 7, 2022
@rafaelcr rafaelcr moved this to Recent issues in API Board Jul 7, 2022
@saralab saralab added this to the Q3-2022 milestone Jul 12, 2022
@saralab saralab moved this from Recent issues to Backlog in API Board Jul 12, 2022
@saralab saralab added L Size: Large P2 Priority 2 Critical functionality not working Impacts one/few customers labels Jul 14, 2022
@rafaelcr rafaelcr moved this from Backlog to In Development in API Board Aug 9, 2022
@rafaelcr rafaelcr moved this from In Development to Backlog in API Board Aug 9, 2022
@sabbyanandan sabbyanandan modified the milestones: Q3-2022, Q4-2022 Oct 18, 2022
@smcclellan
Copy link
Contributor

@rafaelcr Can this be closed? The cached/uncached percentage has been improving the last several months, at ~75% now.

@smcclellan smcclellan removed this from the Q4-2022 milestone Aug 2, 2023
@rafaelcr
Copy link
Collaborator Author

rafaelcr commented Aug 2, 2023

@smcclellan we should probably icebox this one. it's a good improvement that we should make at some point.

@blockstack-devops
Copy link

🎉 This issue has been resolved in version 8.1.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@blockstack-devops
Copy link

🎉 This issue has been resolved in version 8.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants