I use varnish with docker - see million12/varnish
GET requests work great !
but i have no idea what i have to set in the settings to cache POST requests.
on google i have found many posts (from 2010 or 2011) where it says that POST requests can not be cached with varnish - is this statement still correct?
Or is there another way to cache POST requests?
here my varnish.vcl settings:
vcl 4.0;
backend default {
...
}
# Respond to incoming requests.
sub vcl_recv {
unset req.http.Cookie;
}
# Set a header to track a cache HIT/MISS.
sub vcl_deliver {
if (obj.hits > 0) {
set resp.http.X-Varnish-Cache = "HIT";
}
else {
set resp.http.X-Varnish-Cache = "MISS";
}
}
# Not cache 400 - 500 status requests
sub vcl_backend_response {
if (beresp.status >= 400 && beresp.status <= 600) {
set beresp.ttl = 0s;
}
}
Thanks for help !