mouse | photo editor mobile that can overlap photos | ubuntu firefox modifications addon | social vk


Preventing JS or CSS Caching on Web Applications

It is very important for dynamic web applications, any js and css changes to become available to user (without need to refresh - reload browser page).

Instead of

<script type="text/javascript" src="index.js"></script>


<script type="text/javascript" src="index.js?version=1"></script>

Everytime you modify JS file, use next version num (actually, you can use any other string, but ?version=n is more nice). So, you force user browser to retreive JS in case it is changed.

The same method can be applied for CSS.

Hope to find it helpful. Your comments are welcomed!

Sign-up for our free email newsletter. Get updates when new tutorials and tips are published. You can unsubscribe anytime with a click.

Your comments are welcomed!

This site actively encourages commenting on any post. Comments are not pre-moderated, but this community does not tolerate direct or indirect attacks, name-calling or insults. Please, read terms of use and Comment Policy at privacy policy.

More tips