服务工作者脱机缓存在JBoss服务器中不起作用

时间:2019-04-23 06:41:00

标签: angular angular-service-worker

service worker离线缓存正在angular推荐的npm http服务器中工作。但是部署在jboss服务器中的同一应用程序在脱机时不会缓存文件。

遵循的步骤:

步骤1: ng添加@ angular / pwa

第二步: ng构建--prod

第3步:部署在https服务器(jboss服务器)中

第4步:以离线模式访问应用程序

第5步: enter image description here

注释: manifest.json

{
  "name": "Sample app",
  "short_name": "app",
  "theme_color": "#2196f3",
  "background_color": "#2196F3",
  "display": "standalone",
  "gcm_sender_id": "103953800507",
  "orientation": "portrait",
  "start_url": "/mxrw/",
"icons": [

ngsw-config.json

{
  "index": "/index.html",
  "assetGroups": [
    {
      "name": "app",
      "installMode": "prefetch",
      "resources": {
        "files": [
          "/favicon.ico",
          "/index.html",
          "/*.css",
          "/*.js"
        ]
      }
    },
    {
      "name": "assets",
      "installMode": "lazy",
      "updateMode": "prefetch",
      "resources": {
        "files": []
      }
    }
  ]
}

0 个答案:

没有答案