-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathnetlify.toml
More file actions
82 lines (69 loc) · 1.8 KB
/
netlify.toml
File metadata and controls
82 lines (69 loc) · 1.8 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
[build]
# Build command
command = "npm run parse-readme && npm run build"
# Directory with the static files (Vite default output)
publish = "dist"
# Functions directory
functions = "netlify/functions"
# Environment variables for build
[build.environment]
NODE_VERSION = "20"
# Build processing
[build.processing]
skip_processing = false
[build.processing.css]
bundle = true
minify = true
[build.processing.js]
bundle = true
minify = true
[build.processing.images]
compress = true
# Redirect rules for SPA (React Router)
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
# Headers for better performance and security
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "strict-origin-when-cross-origin"
# Cache static assets (JS, CSS)
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Cache JavaScript files
[[headers]]
for = "/*.js"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Cache CSS files
[[headers]]
for = "/*.css"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Cache font files
[[headers]]
for = "/fonts/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Cache images
[[headers]]
for = "/*.{png,jpg,jpeg,gif,svg,webp,avif,ico}"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# No cache for HTML
[[headers]]
for = "/*.html"
[headers.values]
Cache-Control = "public, max-age=0, must-revalidate"
# Cache JSON data files
[[headers]]
for = "/*.json"
[headers.values]
Cache-Control = "public, max-age=3600, must-revalidate"