0

I look in some html codes placed the stylesheet in this way:

<link href="styles.css?=121" rel="stylesheet" type="text/css">

what does it mean?

Funny Frontend
  • 3,807
  • 11
  • 37
  • 56

2 Answers2

7

We can clear the CSS style sheet cache by using the query selector like this:

<link rel="stylesheet" href="style.css?v=1.1"> 

When you change the css change the version like this: ?v=1.2 after then your browser will load newly updated css. Note that you can replace to any number each time you change the css.

This will have no effect on the CSS. It will only serve to make the browser think it’s a completely different file.

If you don’t change the value for a while, the browser will continue to cache (or preserve) the file, and won’t attempt to download it unless other factors force it to, or you end up updating the query string value.

You may also be interested in this

Community
  • 1
  • 1
Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231
0

The ?=121 is a query string parameter. As it is used in your example it might be to avoid caching.

If it looked something like ?v=1 then it might be used for selecting different versions of that stylesheet.

Ashley Medway
  • 7,151
  • 7
  • 49
  • 71