Forked from osvaldasvalutis/service-worker-disable-file-cache-nginx
Last active
February 1, 2018 11:27
-
-
Save lusan/880d51c9dcd64c2cefd6a7df130370d7 to your computer and use it in GitHub Desktop.
Service Worker gotchas – https://medium.com/kollegorna/service-worker-gotchas-af20a9dab986
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
location ~* (serviceworker\.js)$ { | |
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; | |
expires off; | |
proxy_no_cache 1; | |
} | |
} | |
# Or try this block | |
location /sw.js { | |
add_header Cache-Control "no-cache"; | |
proxy_cache_bypass $http_pragma; | |
proxy_cache_revalidate on; | |
expires off; | |
access_log off; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment