From 1b708e26efbcb4052becad3d7b6618064c2605a6 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 8 Sep 2015 19:51:15 +0200 Subject: Show cached previews directly --- lib/private/preview.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/private/preview.php b/lib/private/preview.php index 978da1161c2..db2a56f9fa5 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -772,6 +772,12 @@ class Preview { throw new NotFoundException('File not found.'); } + if ($cachedPath = $this->isCached($this->info->getId())) { + header('Content-Type: ' . $this->info->getMimetype()); + $this->userView->readfile($cachedPath); + return; + } + if (is_null($this->preview)) { $this->getPreview(); } -- cgit v1.2.3