Ipstenu / varnish-http-purge

Proxy Cache Purge
Apache License 2.0
46 stars 47 forks source link

use FOSHttpCache client? #5

Open dbu opened 10 years ago

dbu commented 10 years ago

hi, me and some other people built a client library to send purge and ban requests to varnish and also to nginx. this might be useful to reduce the code of this plugin to just the wordpress part, and use a well-tested library to talk with the varnish side. https://github.com/FriendsOfSymfony/FOSHttpCache

if you want to discuss this, i am happy to explain further or clarify questions. we are short before a 1.0 release, it would still be time to adjust something if you miss flexibiltiy somewhere.

Ipstenu commented 10 years ago

That is awesome! I am going to look into this, since we're looking at a major rewrite and that may help a lot.

Sent from my phone

On Jul 20, 2014, at 3:43 AM, David Buchmann notifications@github.com wrote:

hi, me and some other people built a client library to send purge and ban requests to varnish and also to nginx. this might be useful to reduce the code of this plugin to just the wordpress part, and use a well-tested library to talk with the varnish side. https://github.com/FriendsOfSymfony/FOSHttpCache

if you want to discuss this, i am happy to explain further or clarify questions. we are short before a 1.0 release, it would still be time to adjust something if you miss flexibiltiy somewhere.

— Reply to this email directly or view it on GitHub.

dbu commented 10 years ago

great, good timing then it seems :-)

gerdneuman commented 6 years ago

@dbu Just came about this old issue. Interesting.

Is FOSHttpCache working async that is send-and-forget PURGE requests that do not block (waiting for a not needed response)? I've seen some reference to HttpAsyncClient on its GitHub repo. This has been discussed in #56 and #66, and there are doubts about this being possible at all with (single-threaded) php.

dbu commented 6 years ago

the relevant action is in the http dispatcher. you can record requests to send (purge, ban, refresh) any time and we only send them when you call flush. the requests are sent in parallel, but flush waits for everything to terminate.

in the symfony integration, flush is called in the kernel terminate step, that is after the response has been sent to the client, so as not to impact the response time. if wordpress has a similar event/hook then you could flush at that point.