6place
3 votes Vote

Force refresh of CSS

Refreshing doesn't work e.g. if there is some caching mechanism on the server. Here is a snipet that should work:
var t = new Date();
var urlExtra = '&'+t.getHours()+'.'+t.getMinutes()+'.'+t.getSeconds()+'.'+t.getMilliseconds()
...
csslink.href = originalHref + urlExtra;

Note that you would need to make sure that original href contains "?" (add it if it doesn't).

Nux , 09.11.2012, 13:10
Idea status: under consideration

Comments

Leave a comment