class CommandLineOrUnsafeMethod

Reject when running from the command line or when HTTP method is not safe.

The policy denies caching if the request was initiated from the command line interface (drush) or the request method is neither GET nor HEAD (see RFC 2616, section 9.1.1 - Safe Methods).

Hierarchy

File

core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php, line 15

Namespace

Drupal\Core\PageCache\RequestPolicy

Members

Name Modifiers Type Description
CommandLineOrUnsafeMethod::check public function Determines whether delivery of a cached page should be attempted. Overrides RequestPolicyInterface::check
CommandLineOrUnsafeMethod::isCli protected function Indicates whether this is a CLI request.
RequestPolicyInterface::ALLOW constant Allow delivery of cached pages.
RequestPolicyInterface::DENY constant Deny delivery of cached pages.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!PageCache!RequestPolicy!CommandLineOrUnsafeMethod.php/class/CommandLineOrUnsafeMethod/8.1.x