public function setETag(EventInterface $event) {
        $response = $event->getResponse();
        $request = $event->getRequest();

        $routesWithETags = [
            'user' => true,
            'images' => true,
            'image' => true,
            'metadata' => true,
            'globalshorturl' => true,
        ];
        $currentRoute = (string) $request->getRoute();

        if (!isset($routesWithETags[$currentRoute])) {
            // The current route does not use ETags
            return;
        }

        if ($response->isOk()) {
            $response->setETag('"' . md5($response->getContent()) . '"');
        }
    }