summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/theming/lib/Controller/IconController.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php
index 6e51f10c4cc..bbfa73b29ca 100644
--- a/apps/theming/lib/Controller/IconController.php
+++ b/apps/theming/lib/Controller/IconController.php
@@ -97,7 +97,11 @@ class IconController extends Controller {
$svg = file_get_contents($image);
$color = $this->template->getMailHeaderColor();
$svg = $this->colorizeSvg($svg, $color);
- return new DataDisplayResponse($svg, Http::STATUS_OK, ['Content-Type' => 'image/svg+xml']);
+
+ $response = new DataDisplayResponse($svg, Http::STATUS_OK, ['Content-Type' => 'image/svg+xml']);
+ $response->cacheFor(86400);
+ $response->addHeader('Expires', date(\DateTime::RFC2822, $this->timeFactory->getTime()));
+ return $response;
}
/**
@@ -110,7 +114,6 @@ class IconController extends Controller {
* @return StreamResponse|DataResponse
*/
public function getFavicon($app="core") {
- // TODO: we need caching here
$icon = $this->renderAppIcon($app);
$icon->resizeImage(32, 32, Imagick::FILTER_LANCZOS, 1);
$icon->setImageFormat("png24");
@@ -131,7 +134,6 @@ class IconController extends Controller {
* @return StreamResponse|DataResponse
*/
public function getTouchIcon($app="core") {
- // TODO: we need caching here
$icon = $this->renderAppIcon($app);
$icon->resizeImage(512, 512, Imagick::FILTER_LANCZOS, 1);
$icon->setImageFormat("png24");