You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/isr.md
+19-7
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,15 @@ request is made for stale content, the page will be regenerated in the backgroun
21
21
but it can take up to 60 seconds before the new content is then updated in all CDN nodes if they already had a cached
22
22
copy.
23
23
24
-
If the static regeneration relies on local files in your repository they need to be bundled with the handler functions.
25
-
This can be done by modifying your [file based configuration](https://docs.netlify.com/configure-builds/file-based-configuration).
26
-
An entry to the `included_files` option needs to be added under the `functions` option. You should be careful to not include unnecessary files, particularly large files such as images or videos, because there is a 50MB size limit for each handler function.
27
-
See [Functions Configuration Docs](https://docs.netlify.com/configure-builds/file-based-configuration/#functions) for more info.
28
-
Update your `netlify.toml` file to include the following (assuming local content is located in the /content directory):
24
+
If the static regeneration relies on local files in your repository they need to be bundled with the handler functions.
25
+
This can be done by modifying your
26
+
[file based configuration](https://docs.netlify.com/configure-builds/file-based-configuration). An entry to the
27
+
`included_files` option needs to be added under the `functions` option. You should be careful to not include unnecessary
28
+
files, particularly large files such as images or videos, because there is a 50MB size limit for each handler function.
29
+
See [Functions Configuration Docs](https://docs.netlify.com/configure-builds/file-based-configuration/#functions) for
30
+
more info. Update your `netlify.toml` file to include the following (assuming local content is located in the /content
31
+
directory):
32
+
29
33
```toml
30
34
[functions]
31
35
included_files = ["content/**"]
@@ -37,30 +41,38 @@ If you only need the content for DSG pages, then you can target only that functi
37
41
[functions.__dsg]
38
42
included_files = ["content/**"]
39
43
```
44
+
40
45
or, for SSR pages:
41
46
42
47
```toml
43
48
[functions.__ssr]
44
49
included_files = ["content/**"]
45
50
```
51
+
46
52
If a new deploy is made, all persisted pages and CDN cached pages will be invalidated so that conflicts are avoided. If
47
53
this did not happen, a stale HTML page might make a request for an asset that no longer exists in the new deploy. By
48
54
invalidating all persisted pages, you can be confident that this will never happen and that deploys remain atomic.
49
55
56
+
### On-demand ISR
57
+
58
+
On-Demand ISR (where a path is manually revalidated) is not currently supported on Netlify.
59
+
[Please let us know](https://github.com/netlify/netlify-plugin-nextjs/discussions/1228) if this feature would be useful
60
+
to you, and if so how you would plan to use it.
61
+
50
62
### Alternatives to ISR
51
63
52
64
ISR is best for situations where there are regular updates to content throughout the day, particularly you don't have
53
65
control over when it happens. It is less ideal in situations such as a CMS with incremental updates where you can have
54
66
the CMS trigger a deploy when a page is added or edited. This offers the best performance and avoids unnecesary
55
67
rebuilds.
56
68
57
-
### Static site generation
69
+
####Static site generation
58
70
59
71
For high-traffic pages you can use
60
72
[static generation](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) without
61
73
`revalidate`, which deploys static files directly to the CDN for maximum performance.
62
74
63
-
### Distributed persistent rendering
75
+
####Distributed persistent rendering
64
76
65
77
For less commonly-accessed content you can use return `fallback: "blocking"` from
66
78
[`getStaticPaths`](https://nextjs.org/docs/basic-features/data-fetching#getstaticpaths-static-generation) and defer
0 commit comments