I found out that some websites use css tag like style.css?ver=1. What is this?
style.css?ver=1
What is purpose of ?ver=1?
?ver=1
How do I do it in code?
To avoid caching of CSS. If the website updates their CSS they update the ver to a higher number, therefore browser is forced to get a new file and not use cached previous version. Otherwise a browser may get a new HTML code and old CSS and some elements of the website may look broken.
2.1m questions
2.1m answers
60 comments
57.0k users