Skip to content

Commit

Permalink
Update content/300-accelerate/300-caching.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrell authored May 1, 2024
1 parent 555f194 commit 2d93349
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/300-accelerate/300-caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ When specifying a TTL of 30 seconds and SWR of 60 seconds, the cache serves fres

#### Use case: News articles

Consider a news application where articles are frequently accessed but don't require real-time updates. By setting a `ttl` of 2 hours and an `swr` duration of 5 minutes, Prisma Client can serve cached articles quickly, reducing latency for readers. As long as the articles are within the `ttl`, users get fast responses. After the `ttl` expires, the Prisma Client continues to serve the stale articles for up to an additional 5 minutes, revalidating the cache with the latest news from the database in response to a new query. This helps maintain a balance between performance and freshness.
Consider a news application where articles are frequently accessed but don't require real-time updates. By setting a `ttl` of 2 hours and an `swr` duration of 5 minutes, Prisma Client can serve cached articles quickly, reducing latency for readers. As long as the articles are within the `ttl`, users get fast responses. After the `ttl` expires, Prisma Client continues to serve the stale articles for up to an additional 5 minutes, revalidating the cache with the latest news from the database in response to a new query. This helps maintain a balance between performance and freshness.

## Default cache strategy 

Expand Down

0 comments on commit 2d93349

Please sign in to comment.