F
F
fomiash2020-10-03 00:51:21
JavaScript
fomiash, 2020-10-03 00:51:21

How to cache js file added by js script on click in browser?

Greetings! It is not possible to save the js-file in the browser cache, which is loaded while working with the site (so that the next time it is loaded from the cache).
The file URL does not change, the content does too.
Headers are sent

Cache-control: public
Expires: Wed, 31 Mar 2021 21:47:18 GMT
Pragma: no-cache

Added to the end of body
...

<script src="/path/to/file/" type="text/javascript"></script>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question