From b40c7df25763c2975e8d3a630c1fa2e0ee5fc249 Mon Sep 17 00:00:00 2001 From: Evgeniy Scherbina Date: Tue, 17 Oct 2023 10:23:00 -0400 Subject: [PATCH] Update CACHING.md --- architecture/CACHING.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/architecture/CACHING.md b/architecture/CACHING.md index 4784b98..218e762 100644 --- a/architecture/CACHING.md +++ b/architecture/CACHING.md @@ -34,6 +34,36 @@ package provides two different middlewares: ## Cache Invalidation +### Keys Structure + +Keys have such format: + +`query:::` + +For example: + +`query:local-chain:eth_getBlockByNumber:0x72806e50da4f1c824b9d5a74ce9d76ac4db72e4da049802d1d6f2de3fda73e10` + +### Invalidation for specific method + +If you want to invalidate cache for specific method you may run such command: + +`redis-cli KEYS "query:::*" | xargs redis-cli DEL` + +For example: + +`redis-cli KEYS "query:local-chain:eth_getBlockByNumber:*" | xargs redis-cli DEL` + +### Invalidation for all methods + +If you want to invalidate cache for all methods you may run such command: + +`redis-cli KEYS "query::*" | xargs redis-cli DEL` + +For example: + +`redis-cli KEYS "query:local-chain:*" | xargs redis-cli DEL` + ## Architecture Diagrams ### Serve request from the cache (avoiding call to actual backend)