Skip to content

Caching in service worker isn't working when path is generalized. #48714

Closed as not planned

Description

@ChayanNath

Which @angular/* package(s) are the source of the bug?

service-worker

Is this a regression?

Yes

Description

When I'm configuring my dataGroups for caching in ngsw-config.json, if I specify the full path, only then the caching works. Otherwise, It doesn't cache.

This works:
"dataGroups": [{ "name": "getRequestCache", "urls": [ "myapp/ai_models", "myapp/ai_models/parameters" ], "cacheConfig": { "strategy": "freshness", "maxSize": 1000, "maxAge": "3d", "timeout": "10s" } } ]

This doesn't work:
"dataGroups": [{ "name": "getRequestCache", "urls": [ "/**", "/**/**", "/**/**/**" ], "cacheConfig": { "strategy": "freshness", "maxSize": 1000, "maxAge": "3d", "timeout": "10s" } } ]

Is there any way to not write each path specifically and assign a general path, so that everything gets cached?

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

Activity

  1. added this to the needsTriage milestone on Jan 18, 2023
  2. JeanMeche commented on Aug 29, 2025

    @JeanMeche
    Member

    With #63364 we've announced that the service-worker package in now in maintenance mode and will not receive feature PRs and feature requests.

    The message is also visible here: https://angular.dev/ecosystem/service-workers

  3. angular-automatic-lock-bot commented on Sep 29, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  4. locked and limited conversation to collaborators on Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: 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