Skip to content

Commit

Permalink
fix: improve clarity on writing
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur-arch committed Sep 25, 2024
1 parent 79b28a3 commit bdffb4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions content/300-accelerate/300-caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ try {

## Default cache strategy 

Accelerate defaults to **no cache** to avoid counterintuitive issues. Caching can be a powerful tool for improving performance but can also be dangerous if not used correctly.
Accelerate defaults to **no cache** to avoid unexpected issues. While caching can improve performance, incorrect usage may lead to errors.

For example, consider writing a query on a critical path without explicitly defining a cache strategy. If you run the code, you might receive incorrect data without explanation. This could be caused by someone forgetting to disable the default _implicit_ cache behavior. Implicit caching allows these counterintuitive issues to arise, leading to undesirable results.
For instance, if a query is executed on a critical path without specifying a cache strategy, the result may be incorrect, with no clear explanation. This issue often arises when implicit caching is unintentionally left enabled.

You must explicitly opt-in to caching if you want to use it. This makes it clear to developers that caching is not enabled by default and helps prevent counterintuitive issues from occurring.
To avoid such problems, you must explicitly opt-in to caching. This ensures you are aware that caching is not enabled by default, preventing potential errors.

> When no cache strategy is specified or during a cache miss, a Prisma Client with the Accelerate extension routes all queries to the database through a connection pool instance near the database region.
> When no cache strategy is specified or during a cache miss, a Prisma Client with the Accelerate extension routes all queries to the database through a connection pool instance near the database region.

0 comments on commit bdffb4f

Please sign in to comment.