Why Versioning css & js is important
omkar panherkar
Currently Building @shypassist Author : Laravel tips , Chatgpt for Entrepreneur ????? ???? ????, ???? ????????? ??
Why Versioning css & js is important ?
Suppose you didn't version your style.css file and you upload it to the server, there are 100% chances that style.css will not load updated css and apply it to your page, because it's already cached by browser.
Versioning Avoids Bad Caching
This are files without versioning :
CSS
<link rel="stylesheet" type="text/css" href="style.css />
jQuery
<script type='text/javascript' src='script.js'></script>
Now check how to version them :
CSS
<link rel="stylesheet" type="text/css" href="style.css?ver=1.1/>
jQuery
<script type='text/javascript' src='script.js?ver=1.1'></script>
Read Complete Optimization Guide on Kindle :