PHP 클래스 Symfony\Component\HttpKernel\Cache\Cache

저자: Fabien Potencier ([email protected])
상속: implements Symfony\Component\HttpKernel\HttpKernelInterface
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$esi
$kernel
$request
$store
$traces

공개 메소드들

메소드 설명
__construct ( Symfony\Component\HttpKernel\HttpKernelInterface $kernel, Symfony\Component\HttpKernel\Cache\Store $store, Symfony\Component\HttpKernel\Cache\Esi $esi = null, array $options = [] ) Constructor.
getLog ( ) : string Returns a log message for the events of the last request processing.
getRequest ( ) : Request Gets the Request instance associated with the master request.
getTraces ( ) : array Returns an array of events that took place during processing of the last request.
handle ( Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true )

보호된 메소드들

메소드 설명
fetch ( Request $request ) : Response Forwards the Request to the backend and determines whether the response should be stored.
forward ( Request $request, boolean $catch = false, Response $entry = null ) : Response Forwards the Request to the backend and returns the Response.
invalidate ( Request $request ) : Response Invalidates non-safe methods (like POST, PUT, and DELETE).
isFreshEnough ( Request $request, Response $entry ) : boolean Checks whether the cache entry is "fresh enough" to satisfy the Request.
isPrivateRequest ( Request $request ) : boolean Checks if the Request includes authorization or other sensitive information that should cause the Response to be considered private by default.
lock ( Request $request, Response $entry ) : boolean Locks a Request during the call to the backend.
lookup ( Request $request ) : Response Lookups a Response from the cache for the given Request.
pass ( Request $request ) : Response Forwards the Request to the backend without storing the Response in the cache.
processResponseBody ( Request $request, Response $response )
record ( Request $request, string $event ) Records that an event took place.
restoreResponseBody ( Response $response ) : Response Restores the Response body.
store ( Request $request, Response $response ) Writes the Response to the cache.
validate ( Request $request, Response $entry ) : Response Validates that a cache entry is fresh.

메소드 상세

__construct() 공개 메소드

The available options are: * debug: If true, the traces are added as a HTTP header to ease debugging * default_ttl The number of seconds that a cache entry should be considered fresh when no explicit freshness information is provided in a response. Explicit Cache-Control or Expires headers override this value. (default: 0) * private_headers Set of request headers that trigger "private" cache-control behavior on responses that don't explicitly state whether the response is public or private via a Cache-Control directive. (default: Authorization and Cookie) * allow_reload Specifies whether the client can force a cache reload by including a Cache-Control "no-cache" directive in the request. Set it to true for compliance with RFC 2616. (default: false) * allow_revalidate Specifies whether the client can force a cache revalidate by including a Cache-Control "max-age=0" directive in the request. Set it to true for compliance with RFC 2616. (default: false) * stale_while_revalidate Specifies the default number of seconds (the granularity is the second as the Response TTL precision is a second) during which the cache can immediately return a stale response while it revalidates it in the background (default: 2). This setting is overridden by the stale-while-revalidate HTTP Cache-Control extension (see RFC 5861). * stale_if_error Specifies the default number of seconds (the granularity is the second) during which the cache can serve a stale response when an error is encountered (default: 60). This setting is overridden by the stale-if-error HTTP Cache-Control extension (see RFC 5861).
public __construct ( Symfony\Component\HttpKernel\HttpKernelInterface $kernel, Symfony\Component\HttpKernel\Cache\Store $store, Symfony\Component\HttpKernel\Cache\Esi $esi = null, array $options = [] )
$kernel Symfony\Component\HttpKernel\HttpKernelInterface An HttpKernelInterface instance
$store Symfony\Component\HttpKernel\Cache\Store A Store instance
$esi Symfony\Component\HttpKernel\Cache\Esi An Esi instance
$options array An array of options

fetch() 보호된 메소드

This methods is trigered when the cache missed or a reload is required.
protected fetch ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request A Request instance
리턴 Symfony\Component\HttpFoundation\Response A Response instance

forward() 보호된 메소드

Forwards the Request to the backend and returns the Response.
protected forward ( Request $request, boolean $catch = false, Response $entry = null ) : Response
$request Symfony\Component\HttpFoundation\Request A Request instance
$catch boolean Whether to catch exceptions or not
$entry Symfony\Component\HttpFoundation\Response
리턴 Symfony\Component\HttpFoundation\Response A Response instance

getLog() 공개 메소드

Returns a log message for the events of the last request processing.
public getLog ( ) : string
리턴 string A log message

getRequest() 공개 메소드

Gets the Request instance associated with the master request.
public getRequest ( ) : Request
리턴 Symfony\Component\HttpFoundation\Request A Request instance

getTraces() 공개 메소드

Returns an array of events that took place during processing of the last request.
public getTraces ( ) : array
리턴 array An array of events

handle() 공개 메소드

public handle ( Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true )
$request Symfony\Component\HttpFoundation\Request

invalidate() 보호된 메소드

Invalidates non-safe methods (like POST, PUT, and DELETE).
또한 보기: RFC2616 13.10
protected invalidate ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request A Request instance
리턴 Symfony\Component\HttpFoundation\Response A Response instance

isFreshEnough() 보호된 메소드

Checks whether the cache entry is "fresh enough" to satisfy the Request.
protected isFreshEnough ( Request $request, Response $entry ) : boolean
$request Symfony\Component\HttpFoundation\Request A Request instance
$entry Symfony\Component\HttpFoundation\Response A Response instance
리턴 boolean true if the cache entry if fresh enough, false otherwise

isPrivateRequest() 보호된 메소드

Checks if the Request includes authorization or other sensitive information that should cause the Response to be considered private by default.
protected isPrivateRequest ( Request $request ) : boolean
$request Symfony\Component\HttpFoundation\Request A Request instance
리턴 boolean true if the Request is private, false otherwise

lock() 보호된 메소드

Locks a Request during the call to the backend.
protected lock ( Request $request, Response $entry ) : boolean
$request Symfony\Component\HttpFoundation\Request A Request instance
$entry Symfony\Component\HttpFoundation\Response A Response instance
리턴 boolean true if the cache entry can be returned even if it is staled, false otherwise

lookup() 보호된 메소드

When a matching cache entry is found and is fresh, it uses it as the response without forwarding any request to the backend. When a matching cache entry is found but is stale, it attempts to "validate" the entry with the backend using conditional GET. When no matching cache entry is found, it triggers "miss" processing.
protected lookup ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request A Request instance
리턴 Symfony\Component\HttpFoundation\Response A Response instance

pass() 보호된 메소드

Forwards the Request to the backend without storing the Response in the cache.
protected pass ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request A Request instance
리턴 Symfony\Component\HttpFoundation\Response A Response instance

processResponseBody() 보호된 메소드

protected processResponseBody ( Request $request, Response $response )
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response

record() 보호된 메소드

Records that an event took place.
protected record ( Request $request, string $event )
$request Symfony\Component\HttpFoundation\Request
$event string The event name

restoreResponseBody() 보호된 메소드

Restores the Response body.
protected restoreResponseBody ( Response $response ) : Response
$response Symfony\Component\HttpFoundation\Response A Response instance
리턴 Symfony\Component\HttpFoundation\Response A Response instance

store() 보호된 메소드

Writes the Response to the cache.
protected store ( Request $request, Response $response )
$request Symfony\Component\HttpFoundation\Request A Request instance
$response Symfony\Component\HttpFoundation\Response A Response instance

validate() 보호된 메소드

The original request is used as a template for a conditional GET request with the backend.
protected validate ( Request $request, Response $entry ) : Response
$request Symfony\Component\HttpFoundation\Request A Request instance
$entry Symfony\Component\HttpFoundation\Response A Response instance to validate
리턴 Symfony\Component\HttpFoundation\Response A Response instance

프로퍼티 상세

$esi 보호되어 있는 프로퍼티

protected $esi

$kernel 보호되어 있는 프로퍼티

protected $kernel

$request 보호되어 있는 프로퍼티

protected $request

$store 보호되어 있는 프로퍼티

protected $store

$traces 보호되어 있는 프로퍼티

protected $traces