From 1bd69e83e0f227f1e03d7d2f89fab2f8b72a25ca Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 19 Aug 2024 16:13:45 +0200 Subject: [PATCH] wait #7037 @1 --- app/Models/FluidbookExternalInstallServer.php | 13 ++++++++++++- resources/hosting/server/config/httpd.conf | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/Models/FluidbookExternalInstallServer.php b/app/Models/FluidbookExternalInstallServer.php index d488dedcb..659f76c46 100644 --- a/app/Models/FluidbookExternalInstallServer.php +++ b/app/Models/FluidbookExternalInstallServer.php @@ -100,6 +100,8 @@ class FluidbookExternalInstallServer extends ExternalServer if ($this->isHosting()) { $redirections = Json::isJson($this->redirections) ? json_decode($this->redirections, true) : $this->redirections; + $expires = 3600 * 24 * 30; + $content = ' Options -MultiViews -Indexes @@ -115,7 +117,16 @@ class FluidbookExternalInstallServer extends ExternalServer } $content .= ' RewriteRule ' . $redirection['from'] . ' /' . ltrim($redirection['to'], '/') . " [R=308,L]\n"; } - $content .= '' . "\n"; + $content .= ' + + Header set Cache-Control "max-age=' . $expires . ', public" + + + ExpiresActive On + ExpiresDefault "access plus ' . $expires . ' seconds" +'; + + $tmp = Files::tempnam(); file_put_contents($tmp, $content); $this->getTransferDriver()->copyFile($tmp, '.htaccess'); diff --git a/resources/hosting/server/config/httpd.conf b/resources/hosting/server/config/httpd.conf index fade4cecb..fef23ecff 100644 --- a/resources/hosting/server/config/httpd.conf +++ b/resources/hosting/server/config/httpd.conf @@ -1,4 +1,6 @@ LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so +LoadModule expires_module /usr/lib/apache2/modules/mod_expires.so +LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so Options Indexes FollowSymLinks -- 2.39.5