Add Cache-Control "public,max-age=0,must-revalidate" to index.html in SPA example

Add the Cache-Control "public,max-age=0,must-revalidate" for index.html header to the SPA example.

In SPAs the index.html must be prevented from being cached, in the index.html the (hashed) javascript and css file are referenced (these can be cached becaused they get a new random suffix everytime they are built)
This commit is contained in:
Fabian 2024-07-26 10:25:49 +02:00 committed by Francis Lavoie
parent 4a71f732b2
commit 4913508ea6
No known key found for this signature in database
GPG key ID: 52BC55A211F19186

View file

@ -218,7 +218,12 @@ A typical SPA config usually looks something like this:
example.com {
root * /srv
encode gzip
try_files {path} /index.html
route {
try_files {path} /index.html
header /index.html {
Cache-Control "public,max-age=0,must-revalidate"
}
}
file_server
}
```