Repository navigation
Expand file tree
/
Copy pathnetlify.toml
More file actions
58 lines (53 loc) · 2.03 KB
/
Copy pathnetlify.toml
File metadata and controls
58 lines (53 loc) · 2.03 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
[build]
command = "npm run build"
publish = "dist"
# Skip BRANCH DEPLOYS of the manual editor's autosave branch: every save
# in the editor is a commit there, and each was triggering a full site
# build for no audience. The PR deploy preview (context "deploy-preview")
# is the useful artifact and still builds — as does every other branch.
# Netlify ignore semantics: exit 0 = skip the build.
ignore = '[ "$BRANCH" = "manual/editor-drafts" ] && [ "$CONTEXT" = "branch-deploy" ]'
# The cohort cookie only matters on HTML documents. Static assets skip the
# edge function entirely: one less invocation per asset, and — critically —
# the function was defeating 304 revalidation on everything it wrapped.
[[edge_functions]]
function = "cohort"
path = "/*"
excludedPath = [
"/_astro/*",
"/fonts/*",
"/videos/*",
"/effects/*",
"/*.svg",
"/*.ico",
"/*.png",
"/*.webp",
]
# Netlify's default for static files is max-age=0,must-revalidate — every
# page view re-validates every font, bundle and video, which showed up as
# a doubled p90 after launch (fonts alone were ~300 KB per navigation).
#
# /_astro/ files carry a content hash in the name, so a stale cache is
# impossible: new content means a new URL. Immutable is exactly right.
[[headers]]
for = "/_astro/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# The brand fonts are stable-by-name. If a face is ever reissued, rename
# the file (or move fonts through the asset pipeline) — do not edit in
# place, or visitors keep the old face for up to a year.
[[headers]]
for = "/fonts/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Team-call videos and effect stills change rarely but ARE edited in
# place (the effect webps were re-cut on launch day), so a bounded
# max-age rather than immutable.
[[headers]]
for = "/videos/*"
[headers.values]
Cache-Control = "public, max-age=604800"
[[headers]]
for = "/effects/*"
[headers.values]
Cache-Control = "public, max-age=86400"