class DefaultRequestPolicy in Drupal 8
Same name in this branch
- 8 core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php \Drupal\Core\PageCache\DefaultRequestPolicy
- 8 core/modules/dynamic_page_cache/src/PageCache/RequestPolicy/DefaultRequestPolicy.php \Drupal\dynamic_page_cache\PageCache\RequestPolicy\DefaultRequestPolicy
Same name and namespace in other branches
- 9 core/modules/dynamic_page_cache/src/PageCache/RequestPolicy/DefaultRequestPolicy.php \Drupal\dynamic_page_cache\PageCache\RequestPolicy\DefaultRequestPolicy
The default Dynamic Page Cache request policy.
Delivery of cached pages is denied if either the application is running from the command line or the request was not initiated with a safe method (GET or HEAD).
Hierarchy
- class \Drupal\Core\PageCache\ChainRequestPolicy implements ChainRequestPolicyInterface
- class \Drupal\dynamic_page_cache\PageCache\RequestPolicy\DefaultRequestPolicy
Expanded class hierarchy of DefaultRequestPolicy
1 string reference to 'DefaultRequestPolicy'
- dynamic_page_cache.services.yml in core/
modules/ dynamic_page_cache/ dynamic_page_cache.services.yml - core/modules/dynamic_page_cache/dynamic_page_cache.services.yml
1 service uses DefaultRequestPolicy
- dynamic_page_cache_request_policy in core/
modules/ dynamic_page_cache/ dynamic_page_cache.services.yml - Drupal\dynamic_page_cache\PageCache\RequestPolicy\DefaultRequestPolicy
File
- core/
modules/ dynamic_page_cache/ src/ PageCache/ RequestPolicy/ DefaultRequestPolicy.php, line 15
Namespace
Drupal\dynamic_page_cache\PageCache\RequestPolicyView source
class DefaultRequestPolicy extends ChainRequestPolicy {
/**
* Constructs the default Dynamic Page Cache request policy.
*/
public function __construct() {
$this
->addPolicy(new CommandLineOrUnsafeMethod());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ChainRequestPolicy:: |
protected | property | A list of policy rules to apply when this policy is evaluated. | |
ChainRequestPolicy:: |
public | function |
Add a policy to the list of policy rules. Overrides ChainRequestPolicyInterface:: |
|
ChainRequestPolicy:: |
public | function |
Determines whether delivery of a cached page should be attempted. Overrides RequestPolicyInterface:: |
|
DefaultRequestPolicy:: |
public | function | Constructs the default Dynamic Page Cache request policy. | |
RequestPolicyInterface:: |
constant | Allow delivery of cached pages. | ||
RequestPolicyInterface:: |
constant | Deny delivery of cached pages. |