archy/scripts/nginx-pwa-snippet.conf

18 lines
758 B
Plaintext
Raw Normal View History

# PWA installability - required for Add to Home Screen on Android
# Include this inside the HTTPS server block for archipelago
# Manifest must have Content-Type: application/manifest+json
location = /manifest.webmanifest {
add_header Content-Type application/manifest+json;
add_header Cache-Control "public, max-age=0, must-revalidate";
}
# Service worker - no cache so updates apply
location ~ ^/(sw\.js|workbox-.*\.js|registerSW\.js)$ {
add_header Content-Type application/javascript;
add_header Service-Worker-Allowed /;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# index.html - avoid aggressive cache for PWA updates
location = /index.html {
add_header Cache-Control "public, max-age=0, must-revalidate";
}