diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-06-14 14:30:39 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-06-14 14:30:39 +0300 |
| commit | 1278f25cb5ccbe343b4c09232ed187b6e90876e6 (patch) | |
| tree | 72d6fddc8e99c7b019de147ed969454c06e669a1 | |
| parent | c55470793a19bdaf689bbbe6d9eb285eff579d98 (diff) | |
| download | gyraf1gov-1278f25cb5ccbe343b4c09232ed187b6e90876e6.tar.gz gyraf1gov-1278f25cb5ccbe343b4c09232ed187b6e90876e6.tar.bz2 gyraf1gov-1278f25cb5ccbe343b4c09232ed187b6e90876e6.zip | |
htaccess optimizations; project is in alfa-3 version
| -rw-r--r-- | public/.htaccess | 49 |
1 files changed, 22 insertions, 27 deletions
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 </IfModule> -# <FilesMatch "\.(ttf|otf|eot|woff|woff2)$"> -# <IfModule mod_headers.c> -# Header set Access-Control-Allow-Origin "*" -# </IfModule> -# </FilesMatch> +### <FilesMatch "\.(ttf|otf|eot|woff|woff2)$"> +### <IfModule mod_headers.c> +### Header set Access-Control-Allow-Origin "*" +### </IfModule> +### </FilesMatch> ### 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 -<filesMatch ".+\.(jpg|jpeg|png|webp|gif|ico)$"> +<filesMatch ".(jpg|jpeg|png|webp|gif|ico)$"> Header set Cache-Control "max-age=8640000, public" </filesMatch> -# CACHE-CONTROL FONTS 200days -<filesMatch "/+\.(ttf|woff|woff2)$"> +# CACHE CONTOL FONTS 200 daus +<filesMatch ".(ttf|woff|woff2)$"> Header set Cache-Control "max-age=17280000, public" </filesMatch> # CACHE-CONTROL CSS and JS 30days -### <filesMatch ".(css|js)$"> -### Header set Cache-Control "max-age=2592000, public" +### <filesMatch ".(css|js)$"> +### Header set Cache-Control "max-age=2592000, public" ### </filesMatch> + ### ### EXPIRATION DATES -# EXPIRATION DATE BY TYPE +### # EXPIRATION DATE BY TYPE <IfModule mod_expires.c> 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" </IfModule> # 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 |
