Commit 1891471b authored by mark burdett's avatar mark burdett Committed by Leon Kessler
Browse files

Issue #2539916 by dawehner, mfb: Send the purge query out in a non blocking way

parent 3406671f
Loading
Loading
Loading
Loading
+6
Changes for README.txt: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -102,3 +102,9 @@ If you need to edit the VCL file for whatever reason, please be aware of the
following thing:
* Fastly uses Varnish 2, there are some differences in syntax between 2 and 3.
* Do not include any host information in the VCL, this is added later by Fastly.

HTTPRL Module
-------------
This module supports the HTTP Parallel Request & Threading Library module
(https://www.drupal.org/project/httprl). If installed and enabled, this module
can issue PURGE requests without waiting for a response from Fastly.
+11 −2
Changes for fastly.api.inc: 11 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -144,12 +144,21 @@ class Fastly {
   * Performs an actual purge request for the given path.
   */
  protected function purgeQuery($path) {
    drupal_http_request(url($path, array('absolute' => TRUE)), array(
    $url = url($path, array('absolute' => TRUE));
    $options = array(
      'headers' => array(
        'Host' => $_SERVER['HTTP_HOST'],
      ),
      'method' => 'PURGE',
    ));
    );
    if (module_exists('httprl')) {
      // We just want to execute the queue but not wait.
      $options['blocking'] = FALSE;
      httprl_request(array($url), $options);
    }
    else {
      drupal_http_request($url, $options);
    }
  }

  /**