O
O
olezhenka2018-09-29 19:41:11
Nginx
olezhenka, 2018-09-29 19:41:11

How to cache files so that later there are no problems when updating?

I have an index.html on my server which loads all the js and css.
When updating, I simply change the name of the file: *update* And don't cache the index.html file. Is this approach correct?
<script src=/js/fileV1.js></script>
<script src=/js/fileV2.js></script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jasonOk, 2018-09-29
@olezhenka

Right after update
<script src="/js/file.js?v=1.0.1"></script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question