($reportMetadata)
| 212 | } |
| 213 | |
| 214 | private function evaluateIfNoneMatch($reportMetadata) { |
| 215 | $clientETag = $this->getRequestCacheKey(); |
| 216 | if ($clientETag !== null && $clientETag !== '') { |
| 217 | $clientETag = (int)$clientETag; |
| 218 | // Compare with your current version/etag |
| 219 | if ($clientETag === (int)$reportMetadata['version']) { |
| 220 | $response = new DataResponse(null, HTTP::STATUS_NOT_MODIFIED); |
| 221 | $response->addHeader('ETag', '"' . $reportMetadata['version'] . '"'); |
| 222 | $response->addHeader('X-Analytics-Cacheable', 'true'); |
| 223 | return $response; |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | private function getRequestCacheKey(): ?string { |
| 229 | $clientETag = $this->request->getHeader('If-None-Match'); |
no test coverage detected