The best way to do this would be by passing noCache = 1 to the url to clear the localStorage browser when you develop less files, then it sets a cookie to remember, to clear it every time, and then you could put noCache = 0 so that disable the cookie, so the end user cannot delete his local storage when using your site, and you can just leave it.
$(document).ready(function () {<br> if(window.location.href.indexOf("noCache=1") > -1) {<br> $.cookie('noCache', '1', { expires: 1, path: '/' });<br> localStorage.clear();<br> }<br> if(window.location.href.indexOf("noCache=0") > -1) {<br> $.cookie('noCache', '0', { expires: 1, path: '/' });<br> }<br> if ($.cookie('noCache') == '1'){<br> alert ("disabled Cache");<br> localStorage.clear();<br> }<br> });<br> <br>
you will need a jquery cookie for this to work
Danny dunkling
source share