Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/01-app/03-api-reference/02-components/image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -839,22 +839,22 @@ module.exports = {

#### `maximumResponseBody`

The default image optimization loader will fetch source images up to 300 MB in size.
The default image optimization loader will fetch source images up to 50 MB in size.

```js filename="next.config.js"
module.exports = {
images: {
maximumResponseBody: 300_000_000,
maximumResponseBody: 50_000_000,
},
}
```

If you know all your source images are small, you can protect memory constrained servers by reducing this to a smaller value such as 50 MB.
If you know all your source images are small, you can protect memory constrained servers by reducing this to a smaller value such as 5 MB.

```js filename="next.config.js"
module.exports = {
images: {
maximumResponseBody: 50_000_000,
maximumResponseBody: 5_000_000,
},
}
```
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/shared/lib/image-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const imageConfigDefault: ImageConfigComplete = {
minimumCacheTTL: 14400, // 4 hours
formats: ['image/webp'],
maximumRedirects: 3,
maximumResponseBody: 300_000_000, // 300MB
maximumResponseBody: 50_000_000, // 50 MB
dangerouslyAllowLocalIP: false,
dangerouslyAllowSVG: false,
contentSecurityPolicy: `script-src 'none'; frame-src 'none'; sandbox;`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function runTests(mode: 'dev' | 'server') {
},
],
maximumRedirects: 3,
maximumResponseBody: 300000000,
maximumResponseBody: 50000000,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [75],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function runTests(mode: 'dev' | 'server') {
},
],
maximumRedirects: 3,
maximumResponseBody: 300000000,
maximumResponseBody: 50000000,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [42, 69, 88],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/next-image-new/app-dir/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ function runTests(mode: 'dev' | 'server') {
},
],
maximumRedirects: 3,
maximumResponseBody: 300000000,
maximumResponseBody: 50000000,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [75],
Expand Down
2 changes: 1 addition & 1 deletion test/integration/next-image-new/unicode/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function runTests(mode: 'server' | 'dev') {
},
],
maximumRedirects: 3,
maximumResponseBody: 300000000,
maximumResponseBody: 50000000,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [75],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function runTests(url: string, mode: 'dev' | 'server') {
},
],
maximumRedirects: 3,
maximumResponseBody: 300000000,
maximumResponseBody: 50000000,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [75],
Expand Down
2 changes: 1 addition & 1 deletion test/unit/image-optimizer/fetch-external-image.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('fetchExternalImage', () => {
const error = await fetchExternalImage(
'http://example.com/no-body.jpg',
false,
300_000_000
50_000_000
).catch((e) => e)

expect(error).toBeInstanceOf(ImageError)
Expand Down
Loading