Skip to content

Commit d950019

Browse files
committed
how it works readme change
1 parent f6e8e44 commit d950019

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,18 @@ The ORM integration is optional - SQLAlchemy and Django are not required depende
237237

238238
When a function is decorated with `@cache(entity="user")`:
239239

240-
1. The decorator **caches the function result**
240+
1. The decorator **caches the function result as we know it, nothing fancy*
241241
2. It **extracts entity reference IDs** from the result (e.g., `{"id": 42, ...}`
242242
3. It **creates an reverse index** mapping for each entity to cache specific **function calls** containing it
243243

244244
When an entity changes:
245245

246-
1. You call `cache.invalidate_entity("user", 42)`
247-
2. The library **finds all cache keys** - function signatures containing this entity
246+
1. You call `cache.invalidate_entity("user", 42)` (see examples for more)
247+
2. The library **finds all cache keys** - function calls that decorated with `@cache()` containing this entity whether it list or single value (see specifications)
248248
3. Only those **specific caches/function calls are invalidated**
249249

250250

251-
This means you don't need to remember all the different ways an entity might be cached and change your 'read' codebase - just invalidate by entity ID, and all relevant caches are automatically cleared.
251+
Effectively, you end up using traditional caches that can be granularly invalidated within your ecosystem. This means you don't need to remember all the different ways an entity might be cached and change your 'read' codebase - just invalidate by entity ID, and all relevant caches are automatically cleared.
252252

253253
>❗ To ensure cache consistency across the system, please bear in mind these rules:
254254
>* Maintain idempotency across all functions using the same cache key (cache key being - function or entity signature)

0 commit comments

Comments
 (0)