docs: make static deploy cache-safe
This commit is contained in:
@@ -12,6 +12,10 @@
|
||||
# tera.lumbridgecorp.com {
|
||||
# import tera_api
|
||||
# root * /srv/tera/dist
|
||||
# @assets path /assets/*
|
||||
# header @assets Cache-Control "public, max-age=31536000, immutable"
|
||||
# @documents not path /assets/*
|
||||
# header @documents Cache-Control "no-cache"
|
||||
# file_server
|
||||
# }
|
||||
#
|
||||
@@ -32,6 +36,10 @@
|
||||
# office.lumbridgecorp.com {
|
||||
# import tera_api
|
||||
# root * /srv/tera/dist # the SAME root as tera., not a copy
|
||||
# @assets path /assets/*
|
||||
# header @assets Cache-Control "public, max-age=31536000, immutable"
|
||||
# @documents not path /assets/*
|
||||
# header @documents Cache-Control "no-cache"
|
||||
# try_files {path} {path}/index.html /office.html
|
||||
# file_server
|
||||
# }
|
||||
@@ -42,6 +50,10 @@
|
||||
# either. The only line that differs between the two site blocks is the
|
||||
# `try_files` fallback.
|
||||
#
|
||||
# Keep the cache rules in the static handler when the site also serves the API.
|
||||
# The HTML shells and RELEASE_SHA are stable names and must revalidate after a
|
||||
# deploy; Vite's /assets/* files are content-addressed and may stay immutable.
|
||||
#
|
||||
# A deployment that skips this is not broken: the office door keeps working and
|
||||
# simply unfurls with the city's card, which is what it did before there was a
|
||||
# second shell at all.
|
||||
|
||||
Reference in New Issue
Block a user