perf(web): optimize Next.js image processing to prevent timeouts (#6665)

This commit is contained in:
Matti Nannt
2025-10-08 07:02:04 +02:00
committed by GitHub
parent b11fbd9f95
commit 98e3ad1068

View File

@@ -28,6 +28,12 @@ const nextConfig = {
experimental: {},
transpilePackages: ["@formbricks/database"],
images: {
// Optimize image processing to reduce CPU time and prevent timeouts
deviceSizes: [640, 750, 828, 1080, 1200, 1920], // Removed 3840 to avoid processing huge images
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384], // Standard sizes for smaller images
formats: ["image/webp"], // WebP is faster to process and smaller than JPEG/PNG
minimumCacheTTL: 60, // Cache optimized images for at least 60 seconds
dangerouslyAllowSVG: true, // Allow SVG images
remotePatterns: [
{
protocol: "https",