-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
121 changed files
with
349 additions
and
166 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { NextResponse } from "next/server"; | ||
|
||
export const revalidate = 0; | ||
|
||
export async function GET() { | ||
return NextResponse.json({ | ||
now: Date.now(), | ||
now: performance.now(), | ||
}); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...les/(caching)/data-cache/no-fetch/data.ts → ...es/(caching)/_data-cache/no-fetch/data.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export async function getNow(id?: string) { | ||
return Date.now(); | ||
return performance.now(); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 3 additions & 5 deletions
8
...aching)/full-route-cache/dynamic/page.tsx → ...ching)/_full-route-cache/dynamic/page.tsx
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
4 changes: 3 additions & 1 deletion
4
...mples/(caching)/full-route-cache/page.tsx → ...ples/(caching)/_full-route-cache/page.tsx
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
8 changes: 8 additions & 0 deletions
8
src/app/examples/(caching)/_full-route-cache/revalidation/page.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// [!code word:revalidate] | ||
import { Boundary } from "@/app/_components/boundary"; | ||
|
||
export default async function Page() { | ||
"use cache"; | ||
|
||
return <Boundary label="Page">{performance.now()}</Boundary>; | ||
} |
4 changes: 3 additions & 1 deletion
4
...caching)/full-route-cache/static/page.tsx → ...aching)/_full-route-cache/static/page.tsx
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
src/app/examples/(caching)/dynamicIO/directive/component-level/page.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// [!code word:use cache] | ||
|
||
export default async function Page() { | ||
return ( | ||
<div className="space-y-4"> | ||
<NoCached /> | ||
<Cached /> | ||
</div> | ||
); | ||
} | ||
|
||
async function NoCached() { | ||
return <p>no cached: {performance.now()}</p>; | ||
} | ||
|
||
async function Cached() { | ||
"use cache"; | ||
|
||
return <p>cached: {performance.now()}</p>; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/app/examples/(caching)/dynamicIO/directive/file-level/page.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// [!code word:use cache] | ||
|
||
"use cache"; | ||
|
||
export default async function Page() { | ||
return ( | ||
<div> | ||
<p>{performance.now()}</p> | ||
<Child /> | ||
</div> | ||
); | ||
} | ||
|
||
function Child() { | ||
return <p>{performance.now()}</p>; | ||
} |
Oops, something went wrong.