When I update CSS on my website, it shows me older version. It seems as browser save cache of css version.
How to clean cache of my browser and get the last version each time I edit them?
When I update CSS on my website, it shows me older version. It seems as browser save cache of css version.
How to clean cache of my browser and get the last version each time I edit them?
You can use a cache buster when you load your css.
Simply add a ?v=1.1
after the filename :
<link rel='stylesheet' href='styles.css?v=1.1' type='text/css' media='all' />
then increment it when you change your CSS, it will force the browser to reload it and don't use its cached version.
EDIT:
You can also use a PHP variable set anywhere else (in a separate config file for example) to increment it with other several files at the same time without having to always edit your template.
$file_version = 1.1;
Then
<link rel='stylesheet' href='styles.css?v=<?= $file_version ?>' type='text/css' media='all' />
CSS and JS files are cached by the browser and a simple refresh of the page won't load a new version. So changing the url with this non-effective argument will make the browser reload it.