B
B
Bogopodoben2016-12-16 09:51:34
JavaScript
Bogopodoben, 2016-12-16 09:51:34

How to solve SPA angular browser caching issue?

The problem is this. There is a frontend on the local, which is then updated to the site via git.
After updating the site, the browser does not show the changes, you need to wait a couple of hours + ctrl-f5.
It is necessary that updates are applied immediately or at least in a short period of time without any forced page refresh.
PS The solution with css, js is clear. Saw hashes (gulp-rev as an example for gulp).
Solution with templates (html). Unclear.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nicholas, 2016-12-16
@healqq

When building, add version number/hash to filenames.

A
Alexander Aksentiev, 2016-12-16
@Sanasol

need to wait a couple of hours

And you are patient...
Change the path to the file when connecting to the page after the update.
app.js?1
app.js?2
app.js?3
Or use some CloudFlare where you can clear the cache using the link.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question