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
- class \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod implements RequestPolicyInterface
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. |
Please login to continue.