O
O
Oleg Drapeza2017-03-30 14:15:16
JavaScript
Oleg Drapeza, 2017-03-30 14:15:16

How to notify the application about a new version (and force it to reload)?

Good afternoon!
There is a SPA application, scripts and styles are added to index.html when building, with contenthash in the file name.
The index.html itself is not cached.
After deploying a new version of the application, there are two problems:
1) Previously opened clients use the old code.
2) Dynamic requests for individual bundles fail because these files have a new name.
A simple solution suggests itself - force a page reload, or ask the client to do so.
But what is the best way to notify about code changes?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2017-03-30
@SuperOleg39ru

add a separate query that returns the current version, let the client periodically compare its own and the current one

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question