2

I´m using Gridless Boilerplate and this is how the main.css file is called in the header:

<link rel="stylesheet" href="assets/css/main.css?version=1" />

I'd like to know what the purpose of adding "?version1" is.

John Slegers
  • 45,213
  • 22
  • 199
  • 169
Ricardo Fornes
  • 382
  • 1
  • 4
  • 11

2 Answers2

7

It's used to avoid caching issues. When you edit your css file you'll increment that version number and the browser will (presumably) fetch a new copy rather than using its cached version.

See Cache-Busting via params.

Community
  • 1
  • 1
canon
  • 40,609
  • 10
  • 73
  • 97
3

If that file changes over time, by appending that query string you force browsers that normally cache that file to get a fresh copy.

John Conde
  • 217,595
  • 99
  • 455
  • 496