Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Expire module hands off an array of URLs to fastly module, and many HTTP clients, such as curl and httprl, can fire off multiple HTTP requests at once.
We'd need to retrofit the existing methods to accept multiple URLs in one call, or new methods could be added
Comment | File | Size | Author |
---|---|---|---|
#9 | 2562751.patch | 2.35 KB | mfb |
#8 | 2562751.patch | 2.32 KB | mfb |
Comments
Comment #2
Leon Kessler CreditAttribution: Leon Kessler commentedI'm going to mark this as a duplicate of #2539916: Send the purge query out in a non blocking way. (feel free to re-open if you do not agree).
Also, this could be resolved by #2555637: allow fastly module to receive alterable absolute URLs from expire module.
I don't think we need 3 issues for changing the purge request :-)
Comment #3
mfbIt's not a duplicate. The goal of this issue was to support one call to httprl_request() per hook_expire_cache() call.
Because httprl_request() takes an array of URLs to make requests to, rather than one URL like drupal_http_request().
It would be faster to make one call to httprl_request() with an array of all the URLs that need a PURGE request, rather than making one call for each URL.
Comment #4
Leon Kessler CreditAttribution: Leon Kessler commentedOkay but it doesn't look like
httprl_request()
does accept an array: http://cgit.drupalcode.org/httprl/tree/httprl.module#n17Comment #5
mfbThat's an unused branch, see http://cgit.drupalcode.org/httprl/tree/httprl.module?h=7.x-1.x#n1134
Comment #6
Leon Kessler CreditAttribution: Leon Kessler commentedIn that case, happy to re-open.
One question though, how much benefit is there from passing through an array of urls, rather than calling
httprl_request()
multiple times?Comment #7
mfbNot much, it's a micro-optimization, as long as the call is non-blocking. For blocking calls that use httprl, there could be some benefit?
Comment #8
mfbThis patch allows for much faster purging of surrogate keys if HTTPRL is installed (should save 100 ms or more). I made a new method, queryMultiple() which can receive an array of queries and does not return results from the Fastly API call.
Comment #9
mfbslight tweak to only call purgeKeys() if there are keys to purge.
Comment #11
balatin CreditAttribution: balatin as a volunteer commented