|
@@ 167-170 (lines=4) @@
|
| 164 |
|
$response->setClientTtl($this->options['ttl']); |
| 165 |
|
$response->setVary($this->options['user_identifier_headers']); |
| 166 |
|
$response->setPublic(); |
| 167 |
|
if ($this->hasSessionListener && version_compare('4.1', Kernel::VERSION, '<=')) { |
| 168 |
|
// header to avoid Symfony SessionListener overwriting the response to private |
| 169 |
|
$response->headers->set(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER, 1); |
| 170 |
|
} |
| 171 |
|
} else { |
| 172 |
|
$response->setClientTtl(0); |
| 173 |
|
$response->headers->addCacheControlDirective('no-cache'); |
|
@@ 234-237 (lines=4) @@
|
| 231 |
|
} |
| 232 |
|
|
| 233 |
|
// For Symfony 4.1+ if user hash header was in vary or just added here by "add_vary_on_hash" |
| 234 |
|
if ($this->hasSessionListener && \version_compare('4.1', Kernel::VERSION, '<=') && in_array($this->options['user_hash_header'], $vary)) { |
| 235 |
|
// header to avoid Symfony SessionListener overwriting the response to private |
| 236 |
|
$response->headers->set(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER, 1); |
| 237 |
|
} |
| 238 |
|
} elseif ($this->options['add_vary_on_hash']) { |
| 239 |
|
/* |
| 240 |
|
* Additional precaution: If for some reason we get requests without a user hash, vary |