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

CommentFileSizeAuthor
#9 2562751.patch2.35 KBmfb
#8 2562751.patch2.32 KBmfb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mfb created an issue. See original summary.

Leon Kessler’s picture

Status: Active » Closed (duplicate)

I'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 :-)

mfb’s picture

It'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.

Leon Kessler’s picture

Okay but it doesn't look like httprl_request() does accept an array: http://cgit.drupalcode.org/httprl/tree/httprl.module#n17

mfb’s picture

Leon Kessler’s picture

Status: Closed (duplicate) » Active

In 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?

mfb’s picture

Priority: Normal » Minor

Not 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?

mfb’s picture

Status: Active » Needs review
FileSize
2.32 KB

This 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.

mfb’s picture

FileSize
2.35 KB

slight tweak to only call purgeKeys() if there are keys to purge.

  • f9ba772 committed on 7.x-2.x
    Issue #2562751 by mfb, balatin, landing: Handle multiple simultaneous...
balatin’s picture

Status: Needs review » Closed (fixed)