Skip to content

Commit

Permalink
docs: remove added verb and fix good to know section. (#51054)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauek authored Jun 10, 2023
1 parent 6a9fb9e commit bd97c01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/02-app/02-api-reference/01-components/link.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ The default behavior of `Link` is to scroll to the top of the page. When there i

It's common to use [Middleware](/docs/app/building-your-application/routing/middleware) for authentication or other purposes that involve rewriting the user to a different page. In order for the `<Link />` component to properly prefetch links with rewrites via Middleware, you need to tell Next.js both the URL to display and the URL to prefetch. This is required to avoid un-necessary fetches to middleware to know the correct route to prefetch.

For example, if you have want to serve a `/dashboard` route that has authenticated and visitor views, you may add something similar to the following in your Middleware to redirect the user to the correct page:
For example, if you want to serve a `/dashboard` route that has authenticated and visitor views, you may add something similar to the following in your Middleware to redirect the user to the correct page:

```js filename="middleware.js"
export function middleware(req) {
Expand Down
10 changes: 5 additions & 5 deletions docs/02-app/02-api-reference/04-functions/revalidatePath.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export async function GET(request) {
}
```

**Good to know:**

- `revalidatePath` is available in both [Node.js and Edge runtimes](/docs/pages/building-your-application/rendering/edge-and-nodejs-runtimes).
- `revalidatePath` will revalidate _all segments_ under a dynamic route segment. For example, if you have a dynamic segment `/product/[id]` and you call `revalidatePath('/product/[id]')`, then all segments under `/product/[id]` will be revalidated as requested.
- `revalidatePath` only invalidates the cache when the path is next visited. This means calling `revalidatePath` with a dynamic route segment will not immediately trigger many revalidations at once. The invalidation only happens when the path is next visited.
> **Good to know:**
>
> - `revalidatePath` is available in both [Node.js and Edge runtimes](/docs/pages/building-your-application/rendering/edge-and-nodejs-runtimes).
> - `revalidatePath` will revalidate _all segments_ under a dynamic route segment. For example, if you have a dynamic segment `/product/[id]` and you call `revalidatePath('/product/[id]')`, then all segments under `/product/[id]` will be revalidated as requested.
> - `revalidatePath` only invalidates the cache when the path is next visited. This means calling `revalidatePath` with a dynamic route segment will not immediately trigger many revalidations at once. The invalidation only happens when the path is next visited.
## Parameters

Expand Down

0 comments on commit bd97c01

Please sign in to comment.