Skip to content

installMode and large platforms #47705

@GlauberF

Description

@GlauberF

Which @angular/* package(s) are relevant/related to the feature request?

service-worker

Description

I don't know if this would be the right place, but I'm reviewing the ngsw-config.json file.
I would like to download all .js(app) files as soon as the user opens the platform, as it improves performance even more when changing routes, but I'm afraid that this will interfere with requests from the frontend to the api.
because our platform is big, it has several angular modules.
We are a Brazilian financial management platform.
Today I use the following configuration:

{
    "$schema": "./node_modules/@angular/service-worker/config/schema.json",
    "index": "/index.html",
    "assetGroups": [
        {
            "name": "app",
            "installMode": "lazy",
            "updateMode": "prefetch",
            "resources": {
                "files": ["/favicon.ico", "/index.html", "/manifest.webmanifest", "/*.css", "/*.js"]
            }
        },
        {
            "name": "assets",
            "installMode": "lazy",
            "updateMode": "prefetch",
            "resources": {
                "files": ["/assets/**", "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)", "!/**/px.gif"],
                "urls": ["fonts.googleapis.com/**", "googletagmanager.com/**", "google-analytics.com/**", "player.vimeo.com/**", "f.vimeocdn.com/**"]
            }
        }
    ]
}

would change installMode from lazy to prefetch

Proposed solution

.

Alternatives considered

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: service-workerIssues related to the @angular/service-worker package

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions