Skip to content

Commit

Permalink
Remove HEAD request method limitation from On-Demand ISR example (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Jul 26, 2022
1 parent a48b287 commit f74ccc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

6 comments on commit f74ccc9

@vercel
Copy link

@vercel vercel bot commented on f74ccc9 Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

edge-api-routes-query-parameters – ./edge-api-routes/query-parameters

edge-api-routes-query-parameters.vercel.app
edge-api-routes-query-parameters.vercel.sh
edge-api-routes-query-parameters-git-main.vercel.sh

@vercel
Copy link

@vercel vercel bot commented on f74ccc9 Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

edge-api-routes-cache-control – ./edge-api-routes/cache-control

edge-api-routes-cache-control.vercel.app
edge-api-routes-cache-control.vercel.sh
edge-api-routes-cache-control-git-main.vercel.sh

@vercel
Copy link

@vercel vercel bot commented on f74ccc9 Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

edge-api-routes-hello-world – ./edge-api-routes/hello-world

edge-api-route.vercel.app
edge-api-routes-hello-world.vercel.sh
edge-api-routes-hello-world-git-main.vercel.sh

@vercel
Copy link

@vercel vercel bot commented on f74ccc9 Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

edge-api-routes-json-response – ./edge-api-routes/json-response

edge-api-routes-json-response.vercel.app
edge-api-routes-json-response-git-main.vercel.sh
edge-api-routes-json-response.vercel.sh

@vercel
Copy link

@vercel vercel bot commented on f74ccc9 Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

build-output-api-isr – ./build-output-api/on-demand-isr

build-output-api-isr-git-main.vercel.sh
build-output-api-isr.vercel.sh

@vercel
Copy link

@vercel vercel bot commented on f74ccc9 Jul 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.