Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ebb881c

Browse files
committed
add initialising the cache
1 parent 4b1004c commit ebb881c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pages/cloudflare/caching.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,15 @@ const config: OpenNextConfig = {
128128
// ...
129129
};
130130
```
131+
132+
##### 4. Initialise the cache during deployments
133+
134+
In order for the cache to be properly initialised with the build-time revalidation data, you need to setup a command that runs as part of your deploy step.
135+
136+
OpenNext will generate an SQL file during the build that can be used to setup your D1 database.
137+
138+
```sh
139+
wrangler d1 execute NEXT_CACHE_D1 --file .open-next/cache-assets-manifest.sql
140+
```
141+
142+
This should be run as part of each deployment to ensure that the cache is being populated with each build's initial revalidation data.

0 commit comments

Comments
 (0)