mirror of
https://github.com/caddyserver/website.git
synced 2025-04-20 04:15:04 -04:00
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:
parent
4a71f732b2
commit
4913508ea6
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue