public function Request::canCache

Returns whether or not the request can be cached

Return value

bool

Overrides RequestInterface::canCache

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Request.php, line 619

Class

Request
HTTP request class to send requests

Namespace

Guzzle\Http\Message

Code

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;
}