Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove HEAD request method limitation from On-Demand ISR example #369

Merged
merged 1 commit into from Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -15,7 +15,7 @@ function revalidate(host, path) {
hostname: host,
port: 443,
path,
method: 'GET', // MUST be "GET" ("HEAD" and "POST" methods will not work)
method: 'GET', // MUST be "GET" or "HEAD" ("POST" method will not work)
headers: {
'x-prerender-revalidate': bypassToken
}
Expand Down
2 changes: 1 addition & 1 deletion build-output-api/on-demand-isr/README.md
Expand Up @@ -18,7 +18,7 @@ Click on one of the "Revalidate" links to see the associated value update. After

When using Prerender Functions, you may want to revalidate the cache for a specific path based on an event (On-Demand).

To revalidate a path to a Prerender Function, make a `GET` request to that path with a header of `x-prerender-revalidate: <bypassToken>`. The `<bypassToken>` must match the value in that Prerender Function's `<name>.prerender-config.json` file.
To revalidate a path to a Prerender Function, make a `GET` or `HEAD` request to that path with a header of `x-prerender-revalidate: <bypassToken>`. The `<bypassToken>` must match the value in that Prerender Function's `<name>.prerender-config.json` file.

In this demo, you can see this happening with two paths: `/` and `/data`.

Expand Down