NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class CallbackCanCacheStrategy

Determines if a request can be cached using a callback

  Guzzle\Plugin\Cache\DefaultCanCacheStrategy implements Guzzle\Plugin\Cache\CanCacheStrategyInterface
  Guzzle\Plugin\Cache\CallbackCanCacheStrategy

Namespace: Guzzle\Plugin\Cache
Located at Guzzle/Plugin/Cache/CallbackCanCacheStrategy.php

## Methods summary

- `public` `__construct ( \Closure|array|mixed $requestCallback = null, \Closure|array|mixed $responseCallback = null )`
- `public` `canCacheRequest ( Guzzle\Http\Message\RequestInterface $request )`

  Determine if a request can be cached

- `public` `canCacheResponse ( Guzzle\Http\Message\Response $response )`

  Determine if a response can be cached

## Methods detail

# `public`
`__construct( `Closure`|array|mixed $requestCallback = null, `Closure`|array|mixed $responseCallback = null )`

#### Parameters

$requestCallback
  ``Closure`|array|mixed`
  $requestCallback Callable method to invoke for requests
$responseCallback
  ``Closure`|array|mixed`
  $responseCallback Callable method to invoke for responses

#### Throws

``Guzzle\Common\Exception\InvalidArgumentException``
# `public boolean`
`canCacheRequest( `Guzzle\Http\Message\RequestInterface` $request )`

Determine if a request can be cached

#### Parameters

$request
  ``Guzzle\Http\Message\RequestInterface``
  $request Request to determine

#### Returns

`boolean`

#### Overrides

`Guzzle\Plugin\Cache\DefaultCanCacheStrategy::canCacheRequest`
# `public boolean`
`canCacheResponse( `Guzzle\Http\Message\Response` $response )`

Determine if a response can be cached

#### Parameters

$response
  ``Guzzle\Http\Message\Response``
  $response Response to determine

#### Returns

`boolean`

#### Overrides

`Guzzle\Plugin\Cache\DefaultCanCacheStrategy::canCacheResponse`

### Magic methods summary

## Properties summary

`protected callable` | $requestCallback | # Callback for request
`protected callable` | $responseCallback | # Callback for response