Answer the question
In order to leave comments, you need to log in
How to clear user cache in angular app?
And so it is, a large application on angular 11
The assembly takes place by ng build --outputHashing=all
But this does not help, the browser cache is not updated for users, respectively, you yourself understand what this means, while it seems that even the chunks remain old
Statics gives nginx
How to solve this problem?
Answer the question
In order to leave comments, you need to log in
In my case, it turned out that the problem was in the ServiceWorker and the solution was:
constructor(
public updates: SwUpdate
) {
if (updates.isEnabled) {
interval(30 * 60 * 1000).subscribe(() =>
updates.checkForUpdate().then(() => console.log('Проверка обновлений'))
);
}
this.update();
}
update(): void {
this.updates.available.subscribe((event) => this.promptUser(event));
}
promptUser(event: UpdateAvailableEvent): void {
console.log(
'Обновление до новой версии: ',
event.available.hash.substr(0, 6)
);
console.log('Устаревшая версия: ', event.current.hash.substr(0, 6));
this.updates.activateUpdate().then(() => document.location.reload());
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question