You are here

protected function ZeroConfigPurger::getGlobalOptions in Varnish purger 8.2

Retrieve request options used for all purge requests.

Parameters

array[] $extra: Associative array of options to merge onto the standard ones.

Return value

array

2 calls to ZeroConfigPurger::getGlobalOptions()
ZeroConfigPurger::getResultsConcurrently in src/Plugin/Purge/Purger/ZeroConfigPurger.php
Concurrently execute the given requests.
ZeroConfigPurger::invalidateEverything in src/Plugin/Purge/Purger/ZeroConfigPurger.php
Invalidate the entire website.

File

src/Plugin/Purge/Purger/ZeroConfigPurger.php, line 139

Class

ZeroConfigPurger
A purger with minimal configuration required.

Namespace

Drupal\varnish_purger\Plugin\Purge\Purger

Code

protected function getGlobalOptions(array $extra = []) {
  $opt = [
    // Disable exceptions for 4XX HTTP responses, those aren't failures to us.
    'http_errors' => FALSE,
    // Prevent inactive balancers from sucking all runtime up.
    'connect_timeout' => self::CONNECT_TIMEOUT,
    // Prevent unresponsive balancers from making Drupal slow.
    'timeout' => self::TIMEOUT,
    // Deliberately disable SSL verification to prevent unsigned certificates
    // from breaking down a website when purging a https:// URL!
    'verify' => FALSE,
    'User-Agent' => 'Zero Config Purger',
  ];
  return array_merge($opt, $extra);
}