From 95ffe13e2a42fdf82a46ccea2f6bb7d19513792d Mon Sep 17 00:00:00 2001 From: Vladislav Date: Mon, 10 Jan 2022 13:37:15 +0200 Subject: [PATCH 1/2] Urldecode to filename In case, when url contains utf8 symbols, Nginx cache won't work, cause files will be saved with encoded name. --- src/Cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cache.php b/src/Cache.php index f9701b0..446a35c 100644 --- a/src/Cache.php +++ b/src/Cache.php @@ -214,7 +214,7 @@ protected function getDirectoryAndFileNames($request, $response) */ protected function aliasFilename($filename) { - return $filename ?: 'pc__index__pc'; + return urldecode($filename) ?: 'pc__index__pc'; } /** From c29235d6da5a58ac594751a5a120d0df118c586c Mon Sep 17 00:00:00 2001 From: Vladislav Date: Thu, 13 Jan 2022 08:22:44 +0200 Subject: [PATCH 2/2] special char fix for directories --- src/Cache.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Cache.php b/src/Cache.php index 446a35c..7548add 100644 --- a/src/Cache.php +++ b/src/Cache.php @@ -202,8 +202,9 @@ protected function getDirectoryAndFileNames($request, $response) $extension = $this->guessFileExtension($response); $file = "{$filename}.{$extension}"; + $path = urldecode($this->getCachePath(implode('/', $segments))); - return [$this->getCachePath(implode('/', $segments)), $file]; + return [$path, $file]; } /**