Commit Graph

5 Commits

Author SHA1 Message Date
Sebastian "Sebbie" Silbermann 025bf4a5f7 fix(incremental-cache): byte-exact fetch cache key for binary bodies (#96008)
https://github.com/vercel/next.js/security/advisories/GHSA-4633-3j49-mh5q

Co-authored-by: Karim Rahal <karim@karimrahal.com>
2026-07-21 18:46:44 +02:00
Hendrik Liebau 4e51eb2140 Support Uint8Array bodies when generating cache keys for POST requests (#81465)
When opting into caching a POST request with the `revalidate` option, or
when the Server Components HMR Cache implicitly caches a POST request,
the body of the request is now correctly handled if it is a
`Uint8Array`. Previously, we logged `Failed to generate cache key for
...` and the cache was bypassed.

closes NAR-180
2025-07-09 20:32:43 +02:00
Wyatt Johnson eab1fe8397 Enable PPR for dynamic = "force-dynamic" (#58779)
This makes some critical modifications to the app render pipeline when
PPR has been enabled for pages with segments defining:

```js
export const dynamic = "force-dynamic"
```

Importantly, it no longer modifies the revalidation time to zero for
those pages, and now falls back to the provided default revalidation
time. When static render occurs, if the page being rendered has a
segment config defining `dynamic === "force-dynamic"`, then it will
postpone at the root of the component tree. This ensures that no render
code is executed for the page, as the entirety of the tree will have
postponed. This fixes the bug where the flight prefetch wasn't generated
correctly as well.
2023-12-06 01:10:00 +00:00
JJ Kasper 8f5ffed72e Update fetch cache handling with POST requests (#46856)
This updates to no longer skip caching POST or authed requests with the
fetch cache and instead we bail when `cookies()` or `headers()` is used
prior which is a better heuristic to signal user specific data would be
related to the fetch request.

x-ref: [slack
thread](https://vercel.slack.com/archives/C042LHPJ1NX/p1678130069138849)

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2023-03-06 21:30:29 -08:00
JJ Kasper c5336132c3 Fix fetch cache key inputs and encoding (#46392
This ensures we properly filter caching on uncachable request methods by
default and correct encoding handling in edge runtime.

Fixes: https://github.com/vercel/next.js/issues/46349
x-ref: [slack
thread](https://vercel.slack.com/archives/C042LHPJ1NX/p1677253242022489)

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2023-02-24 16:44:47 -08:00