I’m doing a project in Django and using djangos-css (http://github.com/dziegler/django-css) and Sass (http://sass-lang.com/). The Sass files are served in development using django-css. I want to write a JavaScript routine that will every one second retrieve the CSS assets. The purpose of this is so that the designer can edit the Sass files, hit save, and see the result in the browser immediately without switching applications and hitting refresh.
Basically I need a way for JavaScript to force the browser to re-download certain files without doing a page refresh. Is this possible?
The simplest way is usually to add a unique parameter onto the url, I often just use a timestamp
Just be careful if your requests already have parameters then you need to add
&time=' + timstampinstead.The browser can’t cache the request because each request looks unique.