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
2 changes: 1 addition & 1 deletion docs/01-app/03-api-reference/02-components/image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ If no configuration is provided, the default below is used.
```js filename="next.config.js"
module.exports = {
images: {
minimumCacheTTL: 60, // 1 minute
minimumCacheTTL: 14400, // 4 hours
},
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ If no configuration is provided, the default below is used.
```js filename="next.config.js"
module.exports = {
images: {
minimumCacheTTL: 60, // 1 minute
minimumCacheTTL: 14400, // 4 hours
},
}
```
Expand Down
2 changes: 1 addition & 1 deletion errors/invalid-images-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
// disable static imports for image files
disableStaticImages: false,
// minimumCacheTTL is in seconds, must be integer 0 or more
minimumCacheTTL: 60,
minimumCacheTTL: 14400, // 4 hours
// ordered list of acceptable optimized image formats (mime types)
formats: ['image/webp'],
// enable dangerous use of SVG images
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/image-optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export class ImageOptimizerCache {
deviceSizes = [],
imageSizes = [],
domains = [],
minimumCacheTTL = 60,
minimumCacheTTL = 14400,
formats = ['image/webp'],
} = imageData
const remotePatterns = nextConfig.images?.remotePatterns || []
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 @@ -135,7 +135,7 @@ export const imageConfigDefault: ImageConfigComplete = {
loaderFile: '',
domains: [],
disableStaticImages: false,
minimumCacheTTL: 60,
minimumCacheTTL: 14400, // 4 hours
formats: ['image/webp'],
dangerouslyAllowSVG: false,
contentSecurityPolicy: `script-src 'none'; frame-src 'none'; sandbox;`,
Expand Down
8 changes: 4 additions & 4 deletions test/integration/image-optimizer/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ describe('Image Optimizer', () => {
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=86400, must-revalidate',
value: 'public, max-age=14400, must-revalidate',
},
],
},
Expand All @@ -733,7 +733,7 @@ describe('Image Optimizer', () => {
const res = await fetchViaHTTP(appPort, '/_next/image', query, opts)
expect(res.status).toBe(200)
expect(res.headers.get('Cache-Control')).toBe(
`public, max-age=86400, must-revalidate`
`public, max-age=14400, must-revalidate`
)
expect(res.headers.get('Content-Disposition')).toBe(
`attachment; filename="test.webp"`
Expand All @@ -743,7 +743,7 @@ describe('Image Optimizer', () => {
const files = await fsToJson(imagesDir)

let found = false
const maxAge = '86400'
const maxAge = '14400'

Object.keys(files).forEach((dir) => {
if (
Expand All @@ -764,7 +764,7 @@ describe('Image Optimizer', () => {
const res = await fetchViaHTTP(appPort, '/_next/image', query, opts)
expect(res.status).toBe(200)
expect(res.headers.get('Cache-Control')).toBe(
`public, max-age=60, must-revalidate`
`public, max-age=14400, must-revalidate`
)
expect(res.headers.get('Content-Disposition')).toBe(
`attachment; filename="test.webp"`
Expand Down
2 changes: 1 addition & 1 deletion test/integration/image-optimizer/test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function runTests(ctx: RunTestsCtx) {
contentDispositionType = 'attachment',
domains = [],
formats = [],
minimumCacheTTL = 60,
minimumCacheTTL = 14400,
} = nextConfigImages || {}
const avifEnabled = formats[0] === 'image/avif'
let slowImageServer: Awaited<ReturnType<typeof serveSlowImage>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function runTests(mode: 'dev' | 'server') {
search: '',
},
],
minimumCacheTTL: 60,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [75],
sizes: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function runTests(mode: 'dev' | 'server') {
loaderFile: '',
remotePatterns: [],
localPatterns: undefined,
minimumCacheTTL: 60,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [42, 69, 88],
sizes: [
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 @@ -1785,7 +1785,7 @@ function runTests(mode: 'dev' | 'server') {
loaderFile: '',
remotePatterns: [],
localPatterns: undefined,
minimumCacheTTL: 60,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [75],
sizes: [
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 @@ -94,7 +94,7 @@ function runTests(mode: 'server' | 'dev') {
search: '',
},
],
minimumCacheTTL: 60,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [75],
sizes: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function runTests(url: string, mode: 'dev' | 'server') {
loaderFile: '',
remotePatterns: [],
localPatterns: undefined,
minimumCacheTTL: 60,
minimumCacheTTL: 14400,
path: '/_next/image',
qualities: [75],
sizes: [
Expand Down
Loading