I’ve tried setting up cache for a new website, however it is not showing up in dev tools > application > cache storage. GTMetrix and other speed tools are also advising to add expires header.
I’ve added a _headers file to the root, however that didn’t work… I’ve also added headers rules to the netlify.toml file, but again this did not work.
I’ve tripple checked my formatting and can’t see anything wrong.
Is there a specific way the site should be built for this to work? (I’m using nextjs with build command npm run build - the site get’s built fine … just the headers aren’t showing up)
Any assistance would be greatly appreciated!
Here’s the formats of what I’m trying to get working…
_headers file:
/*
Cache-Control: public, max-age=3600, immutable
netlify.toml file:
[[headers]]
for = "/*"
[headers.values]
cache-control = '''
max-age=3600,
public'''
[build]
command = "npm run build"
functions = "out_functions"
publish = "out_publish"