Skip to content

Instantly share code, notes, and snippets.

@illvart
Created January 12, 2020 14:05
Show Gist options
  • Save illvart/2f036626c8ee36809d87f677f4f2aebf to your computer and use it in GitHub Desktop.
Save illvart/2f036626c8ee36809d87f677f4f2aebf to your computer and use it in GitHub Desktop.
netlify.toml (netlify.com) config
[build]
publish = "public"
command = "yarn build" # or gulp default
[[headers]]
for = "/*"
[headers.values]
X-Content-Type-Options = "nosniff"
Strict-Transport-Security = "max-age=31536000"
Referrer-Policy = "no-referrer-when-downgrade"
[[headers]]
for = "/"
[headers.values]
Cache-Control = "no-cache"
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
Feature-Policy = "camera 'none'; geolocation 'none'; microphone 'none'"
Content-Security-Policy = "report-uri https://illvart.report-uri.com/r/d/ct/reportOnly"
Expect-CT = """
max-age=0, report-uri="https://illvart.report-uri.com/r/d/ct/reportOnly"
"""
[[headers]]
for = "*.html"
[headers.values]
Content-Type = "text/html; charset=utf-8"
Cache-Control = "no-cache"
X-UA-Compatible = "IE=Edge"
[[headers]]
for = "/assets/css/*.css"
[headers.values]
Content-Type = "text/css; charset=utf-8"
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "/assets/css/*.min.css"
[headers.values]
Content-Type = "text/css; charset=utf-8"
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "*.js"
[headers.values]
Content-Type = "text/javascript; charset=utf-8"
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "*.min.js"
[headers.values]
Content-Type = "text/javascript; charset=utf-8"
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "*.webmanifest"
[headers.values]
Content-Type = "application/manifest+json; charset=utf-8"
Cache-Control = "public, max-age=31536000, immutable"
# Cache all images on assets/img
[[headers]]
for = "/assets/img/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Cache all fonts on assets/fonts
[[headers]]
for = "/assets/fonts/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment