A
A
ak_wi2017-12-24 16:11:18
css
ak_wi, 2017-12-24 16:11:18

How to change the background-image image on the site so that the browser updates it?

There is a site that updates the background-image for body every day. But the new picture is pulled up to the user only if you update the browser cache. How to make it so that the picture is automatically pulled from the server, and not from the cache

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
doweb, 2017-12-24
@ak_wi

Change the version of the css file every time you update it.
Was main.css
Will Become main.css?v=2
In this case, the user's cache will be updated.

R
Roman Mirilaczvili, 2017-12-24
@2ord

If you change the name of the image with each update, the browser itself will update it.
https://css-tricks.com/strategies-for-cache-bustin...
https://developers.google.com/web/fundamentals/per...
https://developer.mozilla.org/en- US/docs/Web/HTTP/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question