Reputation: 17803
I'm running the following setup: haproxy -> web traffic -> varnish -> nginx (serve static assets) -> node.js (dynamic content) and haproxy -> websockets -> node.js
How can I force browsers to refresh static assets (JavaScript, CSS, ..) after code deployment? (expire/purge the cache?)
Upvotes: 2
Views: 3150
Reputation: 33930
You can add a querystring to the file with a revision number. Increasing the revision number will force all the assets to come back down to the browser.
<script type="text/javascript" src="jquery.min.js?r=223"></script>
Upvotes: 8