我正在为Angular 6中的零售商店开发一个网站,该网站每两周进行一次新促销。我正在使用PWA来预取和缓存促销和图片。问题是,当添加新促销时,旧促销仍会显示,因为它仍缓存在客户端。添加新促销后,是否有办法使缓存过期?
编辑:这是我的ngsw-config.json中的代码
{
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html"
],
"versionedFiles":[
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/icons/**",
"/assets/img/**",
"/assets/recipes/**"
]
}
}
]
}