Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of adding a version in CSS? [duplicate]

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.

like image 820
Ricardo Fornes Avatar asked Dec 07 '25 08:12

Ricardo Fornes


1 Answers

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.

like image 110
canon Avatar answered Dec 08 '25 22:12

canon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!