Bookmarklet to de-cache CSS and images

Update: This code has been replaced.

Save the following as a bookmarklet to dynamically get the latest versions of CSS and images, regardless of caching. This version doesn’t do CSS background images, though.

javascript:(function(){var i,j,x;x=document.getElementsByTagName('link');for(i=0,j=x.length;i<j;i++){x[i].href=x[i].href+'?'+new Date().getTime();}x=document.getElementsByTagName('img');for(i=0,j=x.length;i<j;i++){x[i].href=x[i].href+'?'+new Date().getTime();}})();

One thought on “Bookmarklet to de-cache CSS and images

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>