class UnsafeMethod in Tome 8
Reject when the HTTP method is not safe.
The policy denies caching if request method is neither GET nor HEAD (see RFC 2616, section 9.1.1 - Safe Methods).
@internal
Hierarchy
- class \Drupal\tome_static\PageCache\RequestPolicy\UnsafeMethod implements RequestPolicyInterface
Expanded class hierarchy of UnsafeMethod
File
- modules/
tome_static/ src/ PageCache/ RequestPolicy/ UnsafeMethod.php, line 16
Namespace
Drupal\tome_static\PageCache\RequestPolicyView source
class UnsafeMethod implements RequestPolicyInterface {
/**
* {@inheritdoc}
*/
public function check(Request $request) {
if (!$request
->isMethodCacheable()) {
return static::DENY;
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RequestPolicyInterface:: |
constant | Allow delivery of cached pages. | ||
RequestPolicyInterface:: |
constant | Deny delivery of cached pages. | ||
UnsafeMethod:: |
public | function |
Determines whether delivery of a cached page should be attempted. Overrides RequestPolicyInterface:: |