1

What is the best practise in terms of JavaScript and CSS versioning?

If we don't version then the browser could have a older cached version is z_1.0.js

Using version control will solve this issue but I don't see it used a lot on other websites?

2
  • @IanWatson, Explain your question a little more? Why do you want to version JavaScript and CSS files ? Commented Jun 20, 2015 at 12:20
  • To ensure a change invalidates all old versions that are cached Commented Jun 20, 2015 at 14:50

1 Answer 1

0

You can add a version number in a parameter:

<link rel="stylesheet" href="style.css?version=20150620">

The file itself can just be named style.css, but if you change the version number in your html file, it the browser will load the new version. You can just use the date or whatever for the version number.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.