chore(umami.php, .htaccess): remove duplicate cache rule + clean up cache headers
This commit is contained in:
parent
1ebdc56a1f
commit
4f72f68f68
4 changed files with 29 additions and 14 deletions
|
@ -54,7 +54,6 @@ if ($method === 'GET' && preg_match('#^/utils\.js$#', $forwardPath)) {
|
||||||
|
|
||||||
http_response_code($code);
|
http_response_code($code);
|
||||||
header('Content-Type: application/javascript; charset=UTF-8');
|
header('Content-Type: application/javascript; charset=UTF-8');
|
||||||
header('Cache-Control: public, max-age=60');
|
|
||||||
echo $js;
|
echo $js;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "6.0.7",
|
"version": "6.0.8",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "6.0.7",
|
"version": "6.0.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"html-minifier-terser": "7.2.0",
|
"html-minifier-terser": "7.2.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "6.0.7",
|
"version": "6.0.8",
|
||||||
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -101,11 +101,11 @@ RewriteRule .* /403/index.html [L,R=403]
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
<IfModule mod_deflate.c>
|
<IfModule mod_deflate.c>
|
||||||
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json application/font-woff2
|
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<IfModule mod_brotli.c>
|
<IfModule mod_brotli.c>
|
||||||
AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/json application/font-woff2
|
AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript application/json
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<IfModule mod_expires.c>
|
<IfModule mod_expires.c>
|
||||||
|
@ -113,8 +113,8 @@ RewriteRule .* /403/index.html [L,R=403]
|
||||||
ExpiresDefault "access plus 1 month"
|
ExpiresDefault "access plus 1 month"
|
||||||
ExpiresByType application/font-woff2 "access plus 1 year"
|
ExpiresByType application/font-woff2 "access plus 1 year"
|
||||||
ExpiresByType text/html "access plus 1 hour"
|
ExpiresByType text/html "access plus 1 hour"
|
||||||
ExpiresByType text/css "access plus 1 week"
|
ExpiresByType text/css "access plus 1 month"
|
||||||
ExpiresByType application/javascript "access plus 1 week"
|
ExpiresByType application/javascript "access plus 1 month"
|
||||||
ExpiresByType image/jpeg "access plus 1 month"
|
ExpiresByType image/jpeg "access plus 1 month"
|
||||||
ExpiresByType image/png "access plus 1 month"
|
ExpiresByType image/png "access plus 1 month"
|
||||||
ExpiresByType image/gif "access plus 1 month"
|
ExpiresByType image/gif "access plus 1 month"
|
||||||
|
@ -128,10 +128,26 @@ RewriteRule .* /403/index.html [L,R=403]
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<IfModule mod_headers.c>
|
<IfModule mod_headers.c>
|
||||||
<FilesMatch "\.(css|js|woff2)$">
|
Header append Vary "Accept-Encoding"
|
||||||
Header set Cache-Control "public, max-age=31536000"
|
|
||||||
</FilesMatch>
|
|
||||||
<FilesMatch "\.(html|htm)$">
|
|
||||||
Header set Cache-Control "public, max-age=3600, must-revalidate"
|
|
||||||
</FilesMatch>
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule mod_mime.c>
|
||||||
|
AddType font/woff2 .woff2
|
||||||
|
AddType font/ttf .ttf
|
||||||
|
AddType font/otf .otf
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
# use brotli if available
|
||||||
|
RewriteCond %{HTTP:Accept-Encoding} br
|
||||||
|
RewriteCond %{REQUEST_FILENAME}.br -f
|
||||||
|
RewriteRule ^(.*)$ $1.br [QSA,L]
|
||||||
|
|
||||||
|
# fallback to gzip
|
||||||
|
RewriteCond %{HTTP:Accept-Encoding} gzip
|
||||||
|
RewriteCond %{REQUEST_FILENAME}.gz -f
|
||||||
|
RewriteRule ^(.*)$ $1.gz [QSA,L]
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue