From 0a97e6d1684c8a196ee4c0586b1b15c46fc8fb83 Mon Sep 17 00:00:00 2001 From: Ryan Salazar Date: Thu, 28 May 2026 22:28:55 +0000 Subject: [PATCH] =?UTF-8?q?next.config:=20contentDispositionType=20inline?= =?UTF-8?q?=20=E2=80=94=20fixes=20banner=20ads=20downloading=20instead=20o?= =?UTF-8?q?f=20rendering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- next.config.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/next.config.mjs b/next.config.mjs index 6440594..5520f9f 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -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