Returns whether or not the request can be cached
bool
Overrides RequestInterface::canCache
public function canCache() {
// Only GET and HEAD requests can be cached
if ($this->method != RequestInterface::GET && $this->method != RequestInterface::HEAD) {
return false;
}
// Never cache requests when using no-store
if ($this
->hasCacheControlDirective('no-store')) {
return false;
}
return true;
}