-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: unstable_cache should not cache new result in draft mode (#67772)
### What? In draft mode, as of right now, `unstable_cache` does not read from the static store, but still write to it. This leads to the following scenario: 1. Content Editor enters draft mode to test his content 2. Content Editor skips cache and reads preview data 3. Preview data is written to store 4. Random user without draft mode receives preview data until cache is revalidated again ### Why? There's an early exit before reading from the cache - the new result is written to the cache nonetheless though. ### How? New result is only cached if draft mode is disabled. Co-authored-by: JJ Kasper <jj@jjsweb.site>
- Loading branch information
1 parent
b7f9f1f
commit 92ce2d6
Showing
2 changed files
with
33 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters