O
O
Oslar2019-04-05 11:35:01
Browsers
Oslar, 2019-04-05 11:35:01

How to make changes applied without manually clearing the cache?

I have such a problem.
There is a site, people have already visited it, I made a couple of edits, cleared the cache and everything is fine, the edits are visible, but the problem is that those people who previously visited the site have the old version of the site, I won’t tell my grandmother 50 years old to clean it cache) and so on to everyone else.
How can I make it so that those people who have the old version, go to the site and they already have the latest version of the site.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2019-04-05
@Oslar

Are you talking about the browser cache of scripts and styles? This is solved elementarily, simply by replacing the url of the resource address.

<script src="script.js?ver=1"></script>
<script src="script.js?ver=2"></script>

for the browser, these are two different resources. Just set up the build to change this ver. Instead of ver, you can use any parameter (even without a value), it doesn't matter, it's important to change the url.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question