sw-toolbox: POST request not getting cached

330 Views Asked by At

I want to cache a POST request for 5 minutes. My POST request entry looks like

toolbox.router.post(/myPostApi/, toolbox.cacheFirst, {
    cache: {
        name: 'myCache',
        maxAgeSeconds: 300
    }
});

This is not getting cached. The entries for GET requests in exact similar syntax are working fine. Am I missing something?

1

There are 1 best solutions below

0
On

As per the comment on this github issue, this is NOT allowed by the current specification of service worker.

For reference, the spec discussion is available here