收藏
回答

分包预下载会不会重复下载?

我的包结构如下:

"pages": [

        "pages/catalog/catalog",

        "pages/category/category"

    ],

    "subPackages":[

        {

            "root": "shopping",

            "pages": [

...

            ]

        }, {

              "root": "my",

              "pages": [

...             

              ]

        }

    ],

    "preloadRule": {

        "pages/catalog/catalog": {

            "network": "all",

            "packages": ["shopping", "my"]

        },

        "pages/category/category": {

            "network": "all",

            "packages": ["shopping", "my"]

        }

}


加载pages/catalog/catalog时,会预加载两个包,从pages/catalog/catalog跳到pages/category/category,在开发工具里看到又预加载了那两个包,也就是说,象我这样写法会重复预加载两个包?预加载的包只须加载一次就好了?

回答关注问题邀请回答
收藏

1 个回答

  • 莫名流年
    莫名流年
    2020-06-07

    应该不用担心,走的资源请求,重复请求直接302读本地缓存的.

    2020-06-07
    有用
    回复 1
    • 熊
      2020-06-07
      谢谢,看了其它问题,都说不会重复下载
      2020-06-07
      回复
登录 后发表内容
问题标签