diff --git a/.htaccess b/.htaccess index 34427d9c..cf3c1842 100644 --- a/.htaccess +++ b/.htaccess @@ -36,6 +36,24 @@ Options -Indexes # Ensure Authorization header is passed along RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + + + + +ExpiresActive On +ExpiresByType image/jpg "access 1 year" +ExpiresByType image/jpeg "access 1 year" +ExpiresByType image/gif "access 1 year" +ExpiresByType image/png "access 1 year" +ExpiresByType text/css "access 1 month" +ExpiresByType text/js "access 1 month" +ExpiresByType application/pdf "access 1 month" +ExpiresByType application/javascript "access 1 month" +ExpiresByType application/x-javascript "access 1 month" +ExpiresByType application/x-shockwave-flash "access 1 month" +ExpiresByType image/x-icon "access 1 year" +ExpiresDefault "access 2 days" diff --git a/app/Config/App.php b/app/Config/App.php index 884c19f1..03514f13 100644 --- a/app/Config/App.php +++ b/app/Config/App.php @@ -42,6 +42,9 @@ class App extends BaseConfig */ public string $indexPage = 'index.php'; + + public $compressOutput = true; + /** * -------------------------------------------------------------------------- * URI PROTOCOL diff --git a/public/.htaccess b/public/.htaccess index dbed322f..28a9d8df 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -38,6 +38,22 @@ Options -Indexes RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + +ExpiresActive On +ExpiresByType image/jpg "access 1 year" +ExpiresByType image/jpeg "access 1 year" +ExpiresByType image/gif "access 1 year" +ExpiresByType image/png "access 1 year" +ExpiresByType text/css "access 1 month" +ExpiresByType text/js "access 1 month" +ExpiresByType application/pdf "access 1 month" +ExpiresByType application/javascript "access 1 month" +ExpiresByType application/x-javascript "access 1 month" +ExpiresByType application/x-shockwave-flash "access 1 month" +ExpiresByType image/x-icon "access 1 year" +ExpiresDefault "access 2 days" + + # If we don't have mod_rewrite installed, all 404's # can be sent to index.php, and everything works as normal.