-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
REST RPC/Client Caching #4008
Comments
If I understood the proposal is to build a caching system that seats between REST handlers and their interaction with the underlying RPC layer right? So two queries should not produce two searches, but only the first one if (let's say) route is identical: If we keep it simple enough should be feasible to maintain, but we have to be careful, sometimes internal caching opens a pandora box. |
Correct.
Not quite. Such a query can produce varying results depending on when they're executed (e.g. delegator rewards). As such, querier requests should not be cached -- only RPC calls (e.g. get tx, get block, get X).
Hmm, what kind of pandora's box will be opened? When would we want to disable caching? |
Depending on which layer the cache is set it can eventually create some discussions:
Can I ask an example code-wise where the cache should reside? Being able to disable it could be useful for development and testing where data is expected to change is very short time frames and we don't want to slow down the tests |
There are no routes to cache really. We're only caching RPC calls from
So really only a few RPC calls would be cached. We'd have to handle verification as well. |
I guess the first three will have no issues then. node.TxSearch(query, prove, page, limit) |
What concerns me the most is cache invalidation for |
This might be overkill for 2-3 RPC endpoints. Thinking we should close this for now. |
If you agree we could address this, for now, by suggesting to people to use some proxy to cache their requests:
|
Summary
As it stands, currently the REST client has no caching mechanisms or layers in place in either serving inbound requests or outbound RPC requests. Granted, the former can, and most often is, be done by a proxy service (e.g. nginx). However, the latter is not cached internally.
As the REST client evolves to become more complex in its data aggregation and servicing, I imagine it will need to start caching some of these outbound RPC requests. e.g. #4007
Note, I'm referring to caching RPC queries that query for content that is static (e.g blocks, txs, validator sets at a given height, etc...) and not Gaia querier requests.
Thoughts @jackzampolin @sabau @faboweb
For Admin Use
The text was updated successfully, but these errors were encountered: