0
I took a virtual store to do some updates, and so far so good. I did, etc...
The problem is this. CSS modifications only apply in the clients' browser if they clear their browser history. If for example, they entered the site a week before, and today, after the update I did, they enter again, the site will still get that CSS information the last time his site "downloaded my site".
Since the store is Magento, it has the options to clear cache, and it also has the part to clear CDN cache, but it’s no use.
Is there anything in PHP or Javascript that makes it erase this data from the client’s browser?
With PHP it’s impossible. I don’t know if there’s anything in JS to do something like this. Anyway, the best idea is to "Versionar" the CSS file and always use a different name in it, this will make the browser be required to download it.
– Jéf Bueno
I liked this solution, of Versionar, thank you LINQ!
– Lucas de Carvalho
No need to rename the file, just pass a querystring to it, for example
script.js?v=123
.– bfavaretto
As the friend @bfavaretto said, you can also add a dynamic querystring always updated with
echo
:meu_css.css?<?php echo date("ymdHis"); ?>
, with year, month, day, hour, minute and seconds.– Sam
There is no way a code via HTML can do this kind of intervention on the client’s machine. Either you create mechanisms to "cheat" the browser (like the suggestions in the other comments) or ask the user to access the browser settings and clear the cache (not recommended).
– Sam