mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-22 12:30:22 +00:00
Cache the shared app shell HTML
This commit is contained in:
+5
-9
@@ -304,18 +304,14 @@ server {
|
||||
}
|
||||
|
||||
|
||||
# Root location with short Nginx cache but no browser cache
|
||||
# Root location with short shared cache for the app shell
|
||||
location = / {
|
||||
proxy_pass http://127.0.0.1:3000;
|
||||
|
||||
# Tell browsers not to cache
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
|
||||
add_header Pragma "no-cache";
|
||||
add_header Expires "0";
|
||||
|
||||
# But let Nginx cache for 1 second to reduce load
|
||||
|
||||
# Cache the shared app shell briefly at the proxy; browser/CDN policy
|
||||
# comes from the upstream Cache-Control header.
|
||||
proxy_cache STATIC;
|
||||
proxy_cache_valid 200 302 1s;
|
||||
proxy_cache_valid 200 302 300s;
|
||||
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
|
||||
proxy_cache_lock on;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user