Force Reload CSS Locally

I often run into caching issues and fight the browser and / or server to give me the latest revision of a stylesheet. This is one of the most frustrating complications in my line of work as a developer / designer. I found this awesome write-up on force reloading CSS locally!

The author includes a bookmarklet and the source so it can be implemented on a site. I personally decided to use this on my network in a modal window alongside other links like admin login and troubleshooting 🙂

Just drop this into an anchor link and you’re set!

javascript:(function(){var h,a,f;a=document.getElementsByTagName('link');for(h=0;h<a.length;h++){f=a[h];if(f.rel.toLowerCase().match(/stylesheet/)&amp;&amp;f.href){var g=f.href.replace(/(&amp;|%5C?)forceReload=\d+/,'');f.href=g+(g.match(/\?/)?'&amp;':'?')+'forceReload='+(new Date().valueOf())}}})()