-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
97 lines (95 loc) · 3.39 KB
/
Copy pathnext.config.js
File metadata and controls
97 lines (95 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/** @type {import('next').NextConfig} */
const nextConfig = {
// ── Concurrency Throttling ─────────────────────────────────────────
// Tells Next.js to compile pages sequentially.
// This prevents triggering Bluehost's concurrent rate-limiting firewalls.
experimental: {
workerThreads: false,
cpus: 1,
// Keep RSC payloads in the client router cache so back/forward nav is instant
staleTimes: {
dynamic: 180, // 3 minutes — navigating back serves cached RSC payload
static: 600, // 10 minutes
},
},
images: {
// Disable Vercel Image Optimization to eliminate usage charges and serve direct from origin
unoptimized: true,
// Serve AVIF first (30–50% smaller than WebP), fall back to WebP
formats: ['image/avif', 'image/webp'],
// Cache optimised images for 30 days in the browser/CDN
minimumCacheTTL: 2592000,
remotePatterns: [
// ── New Active Live Subdomain ──────────────────────────────────
{
protocol: 'https',
hostname: 'admin.discountproducts.co.uk',
pathname: '/wp-content/uploads/**',
},
// ── Cloudflare R2 Storage ──────────────────────────────────────
{
protocol: 'https',
hostname: 'pub-8d1174ef87b14259ae896366fb94672b.r2.dev',
pathname: '/wp-content/uploads/**',
},
// ── Cloudflare Workers Proxy ──────────────────────────────────
{
protocol: 'https',
hostname: 'dqp-image-proxy.yusufq2004.workers.dev',
},
// ── Local Development ──────────────────────────────────────────
{
protocol: 'http',
hostname: 'discount-products-backend.local',
},
{
protocol: 'https',
hostname: 'discount-products-backend.local',
},
// ── Placeholders ───────────────────────────────────────────────
{
protocol: 'https',
hostname: 'images.unsplash.com',
},
// ── Gravatar Fallbacks ─────────────────────────────────────────
{
protocol: 'https',
hostname: 'secure.gravatar.com',
},
{
protocol: 'https',
hostname: '*.gravatar.com',
},
{
protocol: 'http',
hostname: 'secure.gravatar.com',
},
{
protocol: 'http',
hostname: '*.gravatar.com',
},
],
},
typescript: {
// Unblocks builds from compile-time type errors
ignoreBuildErrors: true,
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: "frame-ancestors 'self' https://yqwebstudio.com https://*.yqwebstudio.com http://localhost:3000;",
},
{
key: 'X-Frame-Options',
value: 'ALLOWALL',
}
],
},
];
},
};
module.exports = nextConfig;