next.config: contentDispositionType inline — fixes banner ads downloading instead of rendering
Next.js 14+ defaults the image optimizer to Content-Disposition: attachment (SVG XSS protection). That made GIF/PNG banner ads download as files instead of rendering inline — manifesting as "missing banners" on the live site (LiveU 728x90, Telycam 300x250, etc.). Setting contentDispositionType: 'inline' restores the expected render behavior. The strict CSP on optimized images is still in place; we just serve inline now. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,10 @@ const nextConfig = {
|
||||
minimumCacheTTL: 86400,
|
||||
deviceSizes: [640, 750, 828, 1080, 1200, 1920],
|
||||
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
|
||||
// Critical: serve optimized images INLINE, not as attachments. Default
|
||||
// changed to 'attachment' in Next 14 for SVG XSS protection — that
|
||||
// broke our banner ads (browsers tried to download instead of render).
|
||||
contentDispositionType: 'inline',
|
||||
},
|
||||
|
||||
// Performance: compress responses
|
||||
|
||||
Reference in New Issue
Block a user