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
  • 41,615
  • 22
  • 193
  • 161
Ricardo Fornes
  • 342
  • 1
  • 4
  • 10

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
  • 38,844
  • 9
  • 71
  • 94
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
  • 212,985
  • 98
  • 444
  • 485