Allow post caching
See original GitHub issueLibrary Affected: workbox-strategies
Browser & Platform: all browsers
Issue or Feature Request Description: Allow post caching
Developers should be able to cache post
requests as get
requests using cacheKeyWillBeUsed
. Currently there is a check that prevents post caching, which checks the initial request instead of the request returned by cacheKeyWillBeUsed
, which should be respected as a custom cache key.
A related issue #2574 was filed but closed by the author.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Is it possible to cache POST methods in HTTP? - Stack Overflow
So, YES, you can cache POST request response but only if it arrives with appropriate headers. In most cases you don't want to...
Read more >HTTP caching - MDN Web Docs
The HTTP cache stores a response associated with a request and reuses the stored response for subsequent requests.
Read more >Caching HTTP POST Requests and Responses
HTTP caching involves the client, the proxy, and the server. In this post, we will discuss mainly the proxy, which sits between the...
Read more >Cache POST Responses - Akamai TechDocs
Enable caching of POST responses. How it works By default, POST requests are passed to the origin. With this behavior enabled, you can...
Read more >Document Cache Policy with 'Cache Response to POST ... - IBM
You can enable the Cache Response to POST and PUT Requests option only when the Fixed caching policy type is selected. The Fixed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When using
runtimeCaching
ingenerateSW
, you can specify custom plugins via theoptions.plugins
array, along the lines of:I’ve merged your PR, and it will be in the next pre-release of v6.
I think it’s a good idea to perform the method check in the order in which your PR does it, but again, I don’t want to advertise this as “Workbox now supports caching
POST
requests.”