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:
Ryan Salazar
2026-05-28 22:28:55 +00:00
parent 3b4c04b759
commit 0a97e6d168

View File

@@ -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