-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Hello,
I'm tasked with implementing CloudFlare cache invalidation and I've noticed, that HttpProxyClient
design is not really compatible with generic CDN cache invalidation flow.
What usually happens with CDN is rest post request with json body. Single or multiple urls, headers, etc.
And for example it's not possible to supply body to the request factory of the HttpProxyCache
https://github.com/FriendsOfSymfony/FOSHttpCache/blob/master/src/ProxyClient/HttpProxyClient.php#L94
I do realise, that I can just implement ProxyClient
interface and do the rest of the implementation as I need to.
And that HttpProxyClient
is not generic solution, but a specialized version for direct communication with proxy servers line nginx or varnish, but it's kind of feels wrong to have HttpProxyClient
name wise, while it doesn't allow to send body.
Not sure what this issue is about. :) RFC for renaming HttpProxyClient
? Add some mention on CDN's or custom ProxyClient implementation?
CF purge request looks like so
curl -X POST "https://api.cloudflare.com/client/v4/zones/023e105f4ecef8ad9ca31a8372d0c353/purge_cache" \
-H "X-Auth-Email: [email protected]" \
-H "X-Auth-Key: abcdefg" \
-H "Content-Type: application/json" \
--data '{"files":["http://www.example.com/css/styles.css",{"url":"http://www.example.com/cat_picture.jpg","headers":{"Origin":"cloudflare.com","CF-IPCountry":"US","CF-Device-Type":"desktop"}}]}'