If you are working on the website continuously and need to refresh the CSS and JS changes without being cached, there are some options.
You can place the following in the header:
<head>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Last-Modified" content="0">
<meta http-equiv="Cache-Control" content="no-cache, mustrevalidate">
<meta http-equiv="Pragma" content="no-cache">
</head>
If your application is working on php you can also use:
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 1 Jul 2000 05:00:00 GMT"); // Fecha en el pasado
?>
Now, this system will work for you if you are constantly editing the styles or scripts and you need to see results at the moment.
Another solution
Perhaps the most successful solution is to generate versions of the styles or js using ?123
. For example, we generate a random number in php and assign it to the file:
<link rel="stylesheet" href="/css/mi_estilo.css?v=<?php echo(rand()); ?>" />
<script src="/js/mi_script.js?v=<?php echo(rand()); ?>"></script>