// add our cached last-modified validator
if ($entry->headers->
has('Last-Modified'
)) { $subRequest->headers->
set('If-Modified-Since',
$entry->headers->
get('Last-Modified'
));
} // Add our cached etag validator to the environment.
// We keep the etags from the client to handle the case when the client
// has a different private valid entry which is not cached here.
$cachedEtags =
$entry->
getEtag() ?
[$entry->
getEtag()] :
[];
$requestEtags =
$request->
getETags();
if ($etags =
array_unique(array_merge($cachedEtags,
$requestEtags))) { $subRequest->headers->
set('If-None-Match',
implode(', ',
$etags));
} $response =
$this->
forward($subRequest,
$catch,
$entry);
if (304 ==
$response->
getStatusCode()) { $this->
record($request, 'valid'
);
// return the response and not the cache entry if the response is valid but not cached
$etag =
$response->
getEtag();