viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Fix cache control bug, a=chris

Chris Pollett [2020-06-21 07:Jun:st]
Fix cache control bug, a=chris
Filename
src/controllers/ResourceController.php
diff --git a/src/controllers/ResourceController.php b/src/controllers/ResourceController.php
index c24344f64..80a4ccc8f 100644
--- a/src/controllers/ResourceController.php
+++ b/src/controllers/ResourceController.php
@@ -155,12 +155,12 @@ class ResourceController extends Controller implements CrawlConstants
             if (isset($_SERVER['HTTP_RANGE'])) {
                 $this->serveRangeRequest($path, $size, $start, $end);
                 return;
-            } else {
-                $this->web_site->header("Cache-Control: public");
             }
-            if ($allow_cache && !in_array($mime_parts[0], ["video", "audio"]) &&
-                $this->checkUnmodifiedAndProcess($path, $size)) {
-                return;
+            if ($allow_cache) {
+                $this->web_site->header("Cache-Control: public");
+                if ($this->checkUnmodifiedAndProcess($path, $size)) {
+                    return;
+                }
             }
             $this->web_site->header("Content-Length: " . $size);
             $this->web_site->header("Content-Range: bytes $start-$end/$size");
ViewGit