perf: 프로필 공용 정적 자산 경로를 제공한다
Caddy가 commit-digest 공용 asset과 sourcemap을 immutable URL로 제공하고, runtime에 공용 공개 경로를 명시한다.
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
# Defer this header so it replaces vite preview's default no-cache value.
|
||||
@immutableFrontendAssets path_regexp immutableFrontendAssets ^/(gateway|che|kwe|pwe|twe|nya|pya|hwe)/assets/.+-[A-Za-z0-9_-]{8}\.[^/]+$
|
||||
header @immutableFrontendAssets >Cache-Control "public, max-age=31536000, immutable"
|
||||
@immutableSharedProfileAssets path_regexp immutableSharedProfileAssets ^/gateway/profile-assets/[0-9a-f]{40,64}-[0-9a-f]{16}/assets/.+-[A-Za-z0-9_-]{8}\.[^/]+$
|
||||
header @immutableSharedProfileAssets >Cache-Control "public, max-age=31536000, immutable"
|
||||
@frontendRequests path /gateway/* /che/* /kwe/* /pwe/* /twe/* /nya/* /pya/* /hwe/*
|
||||
header @frontendRequests Cache-Control "no-cache"
|
||||
|
||||
@@ -42,6 +44,12 @@
|
||||
uri strip_prefix /gateway/api
|
||||
reverse_proxy runtime:15001
|
||||
}
|
||||
@sharedProfileAsset path_regexp sharedProfileAsset ^/gateway/profile-assets/[0-9a-f]{40,64}-[0-9a-f]{16}/assets/.+$
|
||||
handle @sharedProfileAsset {
|
||||
uri strip_prefix /gateway/profile-assets
|
||||
root * /srv/frontend-artifacts/game-assets/releases
|
||||
file_server
|
||||
}
|
||||
handle /gateway/* {
|
||||
@gatewayPublished file {
|
||||
root /srv/frontend-artifacts/gateway/current
|
||||
|
||||
Reference in New Issue
Block a user