Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

exclude cached reources not working #230

Closed
davidromani opened this issue Aug 9, 2024 · 4 comments
Closed

exclude cached reources not working #230

davidromani opened this issue Aug 9, 2024 · 4 comments

Comments

@davidromani
Copy link
Contributor

Version(s) affected

1.2.x

Description

Due to an old discussion #109 @Spomky has discovered a problem inside code.

How to reproduce

# config/packages/pwa.yaml
pwa:
    serviceworker:
        enabled: true
        src: 'sw.js'
        workbox:
            enabled: true
            cache_manifest: false
            asset_cache:
                regex: '/^(?!\/assets\/bundles\/).*\.(css|js|json|xml|txt|map|ico|png|jpe?g|gif|svg|webp|bmp)$/'
            image_cache:
                enabled: false
            resource_caches:
                -
                    match_callback: "({request, url}) => (url.pathname.startsWith('/') && !url.pathname.startsWith('/assets'))"
                    cache_name: 'navigation'
                    strategy: 'NetworkFirst'
                    network_timeout: 1
                    preload_urls:
                        - '@static_pages'

Set this asset_cache value is not working due that /assets/bundles resources are being always cached (see screenshot).

Captura de pantalla 2024-08-09 a les 15 53 55

Possible Solution

No response

Additional Context

No response

davidromani added a commit to davidromani/pwa-bundle that referenced this issue Aug 9, 2024
@davidromani davidromani mentioned this issue Aug 9, 2024
4 tasks
Spomky pushed a commit that referenced this issue Aug 9, 2024
@Spomky
Copy link
Member

Spomky commented Aug 12, 2024

Closing as resolved.
Many thanks for the PR.

@Spomky Spomky closed this as completed Aug 12, 2024
@davidromani
Copy link
Contributor Author

@Spomky checked here an is working perfect! Many thanks to you.

@Spomky
Copy link
Member

Spomky commented Aug 12, 2024

Impressive!
There was a PWA Badge, but Lighthouse does not show it anymore. I don't know why 🤷‍♂️. (see https://github.com/GoogleChrome/lighthouse/releases/tag/v12.0.0)
The application seems to be fully configured.

2024-08-12_09h59_38

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants