Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

/api route not caching #8

Open
tacman opened this issue Mar 1, 2024 · 1 comment
Open

/api route not caching #8

tacman opened this issue Mar 1, 2024 · 1 comment

Comments

@tacman
Copy link
Contributor

tacman commented Mar 1, 2024

I want to do a NetworkFirst then Cache strategy with this page:

https://phpwa-demo.survos.com/api/items.jsonld?page=1

My configuration is

    serviceworker:
        enabled: true
        src: "sw.js"
        skip_waiting: true
        workbox:
            warm_cache_urls:
                - 'app_homepage'
                - '_api_/items{._format}_get_collection'
            page_fallback: 'app_homepage'

But that route doesn't show up anywhere in the service worker:

https://phpwa-demo.wip/sw.js

@Spomky
Copy link
Member

Spomky commented Mar 2, 2024

It noted the route is cached. The problem is that the call contains query parameters and thus not retrieved form the cached data.
I will update the library to support API calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants