diff options
author | Julius Haertl <jus@bitgrid.net> | 2016-08-16 10:30:56 +0200 |
---|---|---|
committer | Julius Haertl <jus@bitgrid.net> | 2016-11-18 10:23:23 +0100 |
commit | 6c7ebb120485a95f500fc3c3a1c565872980b54f (patch) | |
tree | a5fb554680a01c42d4824bf89539b1b8f46e5e4a /apps/theming | |
parent | d1fcfe8e7dd7f6acf06e6060cbedbca53a6eca0a (diff) | |
download | nextcloud-server-6c7ebb120485a95f500fc3c3a1c565872980b54f.tar.gz nextcloud-server-6c7ebb120485a95f500fc3c3a1c565872980b54f.zip |
Theming: Add icon caching
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming')
-rw-r--r-- | apps/theming/lib/Controller/IconController.php | 8 |
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"); |