Update JavaScript script on the client


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/code-flow.club/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
5 views
How to connect JS on the client site, then at any point the JS scripts can be updated and it picked up all clients, ie reset would be cached by the browser? JS, for example, the connection ID of the widget.
You need to every time you update the script not to request customers to upgrade the code on their websites.
by | 5 views

5 Answers

0 like 0 dislike
header connects loader.js
which never changes (or very rarely)
this file already loads the necessary js files that change often.
and in loadere implement the logic for fiddling situations with caching, versioning and so on.
by
0 like 0 dislike
The prescription the address of the script in the src attribute of the script tag add the query ?v1.0
Ie
\r
\r\r
А после обновления измените на
\r\r
(Или как-нибудь еще)
by
0 like 0 dislike
For example:
\r
\r\r

where 1265756702 — modification time of the file
by
0 like 0 dislike
TC should not be forgotten that different Tama Chromes and other S with the factory settings can paranoid not to update the files.
Therefore — good option — only include the mtime of the file(or the version or anything else) in the file name or change it altogether.
Or completely and completely demolish the caching of files.
\r
Other STABLE versions — much then and there.
by
0 like 0 dislike
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
24,985 users