Last active
June 3, 2018 17:40
-
-
Save b3h3rkz/6113f01105bac92bad777a3e200b7945 to your computer and use it in GitHub Desktop.
Prevent angular app from caching
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
Developing apps with angularjs comes with it's own headaches, one of which is the caching of files in the browser. | |
As a developer you can make use of plugins like Classic Cache Killer or disable caching in devtools. You can't go around asking all | |
your users to clear their cache after every new update | |
After going through several SO posts and blogs, only one solution worked for me(based on my setup). | |
Using Nginx, I added this directive | |
location ~* \.(?:manifest|appcache|html?|xml|json)$ { | |
expires -1; | |
} | |
which was gotten from https://stackoverflow.com/questions/40243633/disable-nginx-cache-for-javascript-files. | |
After adding that, Dayum!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment