-
Notifications
You must be signed in to change notification settings - Fork 232
/
netlify.toml
86 lines (71 loc) · 2.63 KB
/
netlify.toml
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
# Override default `deploy/public` build directory used by legacy branches
# https://app.netlify.com/sites/govuk-design-system-preview/configuration/deploys
[build]
publish = "build"
# A number of the examples in the Design System include <form> elements so that
# users copying the examples have something that requires relatively little
# tweaking to work out the box (in particular Prototype Kit users, for example)
#
# We have some JavaScript to prevent those forms actually being submitted but
# for users who don’t have JavaScript enabled (or who manage to interact with
# the form before the JS has run) it’s still possible to submit the form.
#
# Handle that gracefully by redirecting to a page that explains what has
# happened and what the user needs to do next.
#
# POST requests work just fine. Requires examples to be set up with an action of
# `/form-handler`.
[[redirects]]
from = "/form-handler"
to = "/form-success"
status = 301
# Redirect pages that have moved
[[redirects]]
from = "/community/accessibility-strategy/"
to = "/accessibility/accessibility-strategy/"
status = 301
[[redirects]]
from = "/patterns/telephone-numbers/"
to = "/patterns/phone-numbers/"
status = 301
# Proxy requests for security.txt to the centralised Cabinet Office
# vulnerability disclosure policy (VDP)
#
# https://github.com/alphagov/security.txt
[[redirects]]
from = "/.well-known/security.txt"
to = "https://vdp.cabinetoffice.gov.uk/.well-known/security.txt"
status = 200 # Proxy rather than redirect
[[redirects]]
from = "/security.txt"
to = "https://vdp.cabinetoffice.gov.uk/.well-known/security.txt"
status = 200 # Proxy rather than redirect
# Send different cache-control headers depending on the file path
#
# Asset filenames with fingerprint hashes (fonts, stylesheets, javascripts) are
# given an 'infinite' max-age since the content never changes.
#
# Historically, an 'infinite' max-age is the 32-bit maximum 2,147,483,648.
# https://datatracker.ietf.org/doc/html/rfc9111#section-1.2.2
[[headers]]
for = "*.css"
[headers.values]
Cache-Control = "public,max-age=2147483648,immutable"
[[headers]]
for = "*.js"
[headers.values]
Cache-Control = "public,max-age=2147483648,immutable"
[[headers]]
for = "*.map"
[headers.values]
Cache-Control = "public,max-age=2147483648,immutable"
# Search index JSON with unique fingerprint
[[headers]]
for = "/search-index-*.json"
[headers.values]
Cache-Control = "public,max-age=2147483648,immutable"
# Fonts from GOV.UK Frontend with unique fingerprints
[[headers]]
for = "/assets/fonts/*"
[headers.values]
Cache-Control = "public,max-age=2147483648,immutable"