Closed raphaelarias closed 5 years ago
Because Service Workers cannot cache POST, your solution is valid. I'll update the SW later. When I created this SW dynamic-import was not a thing therefore I didn't see that use case. Thanks.
Now I'm getting it to. Can you please fix it ? Pretty please 🙏
PS: We had to stop using the SW for now, because even with my workaround, it was breaking some of our uploads to S3. We didn't have time to reproduce, and I don't know exactly when it happened, but by removing the SW it fixed.
Thanks for the initiative.
We keep getting this error:
Uncaught (in promise) TypeError: Request method 'POST' is unsupported at sw.js:58
The line with error is:
caches.open(version).then(cache => cache.put(event.request, clonedResponse));
Would you know why is it throwing an error on a dynamic import?
For now I've put:
if (event.request.method !== 'POST') { caches.open(version).then(cache => cache.put(event.request, clonedResponse)); }