1

I have web-site build with angular that is hosted on cloudflare. When I push new version of application on server, I see from dev computer that browser uses old (from disk-cache) version of files. Because it uses previous versions of index.html, runtime, pollyfile and main js code files.

When getting file, I dont see any header from cloudflare instructing cache stail time on browser. Browser Cache TTL is set to default 4h. Also header expect-ct has max-age=604800, but as I read that is for certificate. I also used purge-cache option on cloudflare ('Purge Everything' is the button).

It seams to me that old version of index.html (the first file that is loaded in Angular application) is cached locally and because of that everything falls apart. How to prevent this?

4

1 回答 1

0

Web 服务器应设置标头“缓存控制”值。正如@pastaleg 所说,您可以看到问题我们如何在所有浏览器中控制网页缓存?对于大多数网络服务器。你可以在网上找到 nginx 的答案。

于 2020-09-25T12:57:44.090 回答