Caching POST requests
popkin opened this issue · comments
popkin commented
is it posible to cache POST requests?
thanks in advance
Kevin Robatel commented
First thing, it's not a good idea to cache POST requests. POST requests exists for "posting" something, they have to reach the server.
But some server don't implement POST correctly... By default only GET is allowed to be cached (by the RFC too).
You can add others methods with setHttpMethods(array $methods)
on CacheMiddleware
like that:
$cache = new CacheMiddleware();
$cache->setHttpMethods(['GET' => true, 'POST' => true]);
popkin commented
yeah, this server uses POST even for getting data :( it's a nightmare.
I'll try that, thanks