summaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorJulius Haertl <jus@bitgrid.net>2016-08-16 10:30:56 +0200
committerJulius Haertl <jus@bitgrid.net>2016-11-18 10:23:23 +0100
commit6c7ebb120485a95f500fc3c3a1c565872980b54f (patch)
treea5fb554680a01c42d4824bf89539b1b8f46e5e4a /apps/theming
parentd1fcfe8e7dd7f6acf06e6060cbedbca53a6eca0a (diff)
downloadnextcloud-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.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");