Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
c23f9577
Unverified
Commit
c23f9577
authored
Sep 26, 2024
by
Sebastian Markbåge
Committed by
GitHub
Sep 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable "use cache" outside of dynamicIO (#70538)
parent
a1840471
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
define-env-plugin.ts
packages/next/src/build/webpack/plugins/define-env-plugin.ts
+1
-0
use-cache-wrapper.ts
packages/next/src/server/use-cache/use-cache-wrapper.ts
+5
-0
No files found.
packages/next/src/build/webpack/plugins/define-env-plugin.ts
View file @
c23f9577
...
@@ -183,6 +183,7 @@ export function getDefineEnv({
...
@@ -183,6 +183,7 @@ export function getDefineEnv({
config
.
devIndicators
.
appIsrStatus
config
.
devIndicators
.
appIsrStatus
),
),
'process.env.__NEXT_PPR'
:
checkIsAppPPREnabled
(
config
.
experimental
.
ppr
),
'process.env.__NEXT_PPR'
:
checkIsAppPPREnabled
(
config
.
experimental
.
ppr
),
'process.env.__NEXT_DYNAMIC_IO'
:
!!
config
.
experimental
.
dynamicIO
,
'process.env.__NEXT_AFTER'
:
config
.
experimental
.
after
??
false
,
'process.env.__NEXT_AFTER'
:
config
.
experimental
.
after
??
false
,
'process.env.NEXT_DEPLOYMENT_ID'
:
config
.
deploymentId
||
false
,
'process.env.NEXT_DEPLOYMENT_ID'
:
config
.
deploymentId
||
false
,
'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX'
:
fetchCacheKeyPrefix
??
''
,
'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX'
:
fetchCacheKeyPrefix
??
''
,
...
...
packages/next/src/server/use-cache/use-cache-wrapper.ts
View file @
c23f9577
...
@@ -160,6 +160,11 @@ async function generateCacheEntry(
...
@@ -160,6 +160,11 @@ async function generateCacheEntry(
}
}
export
function
cache
(
kind
:
string
,
id
:
string
,
fn
:
any
)
{
export
function
cache
(
kind
:
string
,
id
:
string
,
fn
:
any
)
{
if
(
!
process
.
env
.
__NEXT_DYNAMIC_IO
)
{
throw
new
Error
(
'"use cache" is only available with the experimental.dynamicIO config.'
)
}
const
cacheHandler
=
cacheHandlerMap
.
get
(
kind
)
const
cacheHandler
=
cacheHandlerMap
.
get
(
kind
)
if
(
cacheHandler
===
undefined
)
{
if
(
cacheHandler
===
undefined
)
{
throw
new
Error
(
'Unknown cache handler: '
+
kind
)
throw
new
Error
(
'Unknown cache handler: '
+
kind
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment