-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
47 lines (42 loc) · 1.36 KB
/
Copy pathnext.config.js
File metadata and controls
47 lines (42 loc) · 1.36 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
/** @type {import('next').NextConfig} */
const nextConfig = {
// Optimisation images activée (WebP/AVIF auto)
images: {
formats: ["image/avif", "image/webp"],
deviceSizes: [390, 640, 828, 1080, 1200, 1920],
imageSizes: [64, 128, 256, 384],
minimumCacheTTL: 31536000, // 1 an
},
// Headers de performance et sécurité
async headers() {
return [
{
source: "/(.*)",
headers: [
// Sécurité
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "X-Frame-Options", value: "SAMEORIGIN" },
{ key: "X-XSS-Protection", value: "1; mode=block" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{ key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
// Performance
{ key: "Vary", value: "Accept-Encoding" },
],
},
// Cache long sur les assets statiques
{
source: "/(.*)\\.(png|jpg|jpeg|webp|avif|ico|svg|woff2|woff)",
headers: [
{ key: "Cache-Control", value: "public, max-age=31536000, immutable" },
],
},
];
},
// Compression activée
compress: true,
// Pas de powered-by header
poweredByHeader: false,
// Bundle analyzer (décommenter pour analyser)
// experimental: { bundleAnalyzer: true },
};
module.exports = nextConfig;