Skip to content

Commit 06818ce

Browse files
committed
Update README.
1 parent e4a0624 commit 06818ce

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<small>(beta)</small>
55
</h1>
66

7-
Give your ZenStack app a boost with query caching integrated at the ORM level.
7+
Reduce response times and database load with query-level caching integrated with the ZenStack ORM.
88
</div>
99

1010
<div align="center">
@@ -28,7 +28,7 @@
2828

2929
## Features
3030
* 🌐 **Redis Caching:** Centralizes your caching to scale across different systems.
31-
* 🖥️ **Memory Caching:** Simplifies caching where scale is not a concern.
31+
* 🖥️ **Memory Caching:** Simplifies caching when scale is not a concern.
3232

3333
## Requirements
3434

@@ -111,6 +111,10 @@ After performing a query, you can check where the result came from.
111111
const publishedPostsStatus = client.$cache.status // 'hit' | 'miss' | 'stale'
112112
```
113113

114+
* `hit` - a cache entry in the `ttl` window was found, and the database was not queried.
115+
* `miss` - a cache entry was not found, and the database was queried.
116+
* `stale` - a cache entry in the `swr` window was found, and the database was queried in the background to revalidate it.
117+
114118
## Revalidation
115119

116120
If the result was stale, you can choose to await its revalidation.
@@ -124,7 +128,7 @@ const revalidatedPublishedPosts = await client.$cache.revalidation as Post[]
124128
* `swr` reduces response times by serving cached results, but does not reduce database load because it performs a revalidation in the background after each request.
125129

126130
> [!NOTE]
127-
> The total TTL of a cache entry is equal to its `ttl` + `swr`
131+
> The total TTL of a cache entry is equal to its `ttl` + `swr`. The `ttl` window comes first, followed by the `swr` window.
128132
129133
You can combine the two options to best suit the needs of your application.
130134

0 commit comments

Comments
 (0)