public function storeInCache(EventInterface $event)
{
$request = $event->getRequest();
$response = $event->getResponse();
$cacheKey = $this->getCacheKey($request->getUser(), $request->getImageIdentifier());
// Store the response in the cache for later use
if ($response->getStatusCode() === 200) {
$metadata = [];
if ($model = $response->getModel()) {
$metadata = $model->getData();
}
$this->cache->set($cacheKey, ['lastModified' => $response->getLastModified(), 'metadata' => $metadata]);
}
}