feat: Cache results#982
Draft
nutsalhan87 wants to merge 20 commits into
Draft
Conversation
claude debug skill was specific to my system flake should be in another feat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #859 — Cache Results.
What is done
Caching query results in selected backend. Only non-write queries and queries not in transaction cached. Query parser enabled required.
Cache configured via config file:
Theoretically multiple backends supported because cache storage defined by trait. But implemented only Redis.
There are two policies:
cache— cache all (acceptable to cache) queries by defaultno_cache(default) — cache only those queries which have cache hintHints are:
cache [ttl = N]— cache this query with provided ttl, or use default ttl from configforce_cache [ttl = N]— force update cache for the query in cache storageno_cache— do not cache query even if there is "cache" policyThese hints can be provided via query comments (
pgdog_cache) or connection parameters (pgdog.cache):psql postgresql://postgres:postgres@127.0.0.1:5432/postgres?options=-c%20pgdog.cache%3DcacheAnd many more in
docs/CACHE.md.What is not done