From 555f1949c3b586cc4747075a610cf2c90e4eee84 Mon Sep 17 00:00:00 2001 From: Nurul Sundarani Date: Fri, 26 Apr 2024 19:45:25 +0530 Subject: [PATCH] Update 300-caching.mdx Updated Example to clarify the `ttl` and `swr` behaviour. --- content/300-accelerate/300-caching.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/300-accelerate/300-caching.mdx b/content/300-accelerate/300-caching.mdx index 1109f8a331..22da6b6fbb 100644 --- a/content/300-accelerate/300-caching.mdx +++ b/content/300-accelerate/300-caching.mdx @@ -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, Prisma Client serves the stale articles for an additional 5 minutes while fetching the latest news from the database, maintaining 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, 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. ## Default cache strategy