From 1278f25cb5ccbe343b4c09232ed187b6e90876e6 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Wed, 14 Jun 2023 14:30:39 +0300 Subject: htaccess optimizations; project is in alfa-3 version --- public/.htaccess | 49 ++++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) (limited to 'public') diff --git a/public/.htaccess b/public/.htaccess index 313051b..15df7c8 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1,11 +1,13 @@ ## Introduce the Server Header add Origin-Name coder + ### Deny access to specific folders ## deny all files too RedirectMatch 403 ^/app/.*$ RedirectMatch 403 ^/cache/.*$ + RedirectMatch 403 ^/processed-views/.*$ ## deny folders only RedirectMatch 403 ^/css/?$ @@ -35,11 +37,11 @@ Header add Origin-Name coder -# -# -# Header set Access-Control-Allow-Origin "*" -# -# +### +### +### Header set Access-Control-Allow-Origin "*" +### +### ### SERVER SIDE OPTIMIZATIONS @@ -55,31 +57,30 @@ AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript -AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/json - ### ### CACHE-CONTROL HEADERS # CACHE-CONTROL IMAGES 100days - + Header set Cache-Control "max-age=8640000, public" -# CACHE-CONTROL FONTS 200days - +# CACHE CONTOL FONTS 200 daus + Header set Cache-Control "max-age=17280000, public" # CACHE-CONTROL CSS and JS 30days -### -### Header set Cache-Control "max-age=2592000, public" +### +### Header set Cache-Control "max-age=2592000, public" ### + ### ### EXPIRATION DATES -# EXPIRATION DATE BY TYPE +### # EXPIRATION DATE BY TYPE ExpiresActive On @@ -92,24 +93,18 @@ AddOutputFilterByType DEFLATE application/json ExpiresByType image/png "access plus 100 days" ExpiresByType image/jpg "access plus 100 days" ExpiresByType image/jpeg "access plus 100 days" - ExpiresByType image/webp "access plus 100 days" + ExpiresByType image/webp "access plus 200 days" - # Fonts - ExpiresByType font/woff2 "access plus 200 days" ExpiresByType font/ttf "access plus 200 days" + ExpiresByType font/woff "access plus 200 days" + ExpiresByType font/woff2 "access plus 200 days" -### # CSS -### #: ExpiresByType text/css "access plus 1 month" -### # Javascript -### #: ExpiresByType application/javascript "access plus 1 year" + # CSS +### ExpiresByType text/css "access plus 2 days" + # Javascript +### ExpiresByType application/javascript "access plus 1 year" # Remove Server's Signature -### ServerSignature Off - -# also check: -# TODO: MOVE MOST INTO *.conf file -# + https://stackoverflow.com/questions/10816808/header-expires-not-working -# + https://linuxdigest.com/howto/how-to-set-max-age-in-apache2-cache-control-headers/ -# + https://serverfault.com/questions/363692/apache-deflate-ignores-javascript \ No newline at end of file +### ServerSignature Off \ No newline at end of file -- cgit v1.2.3