From 9a073eba9724e13d515382342a23a988e009ffed Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 15 Aug 2023 23:46:32 +0000 Subject: [PATCH 1/2] feat: Add better cache for stati elements --- nginx.conf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index ef76d3b..b0cf375 100644 --- a/nginx.conf +++ b/nginx.conf @@ -28,7 +28,7 @@ http { } # Plausible script - location /js/index.js { + location /js/script.js { # Change this if you use a different variant of the script proxy_pass https://plausible.io/js/script.js; proxy_set_header Host plausible.io; @@ -48,5 +48,17 @@ http { proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; } + + # Media: images, icons, video, audio, HTC + location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webp|webm|htc|woff2|woff)$ { + expires 1y; + access_log off; + } + + # CSS and Javascript + location ~* \.(?:css|js)$ { + expires 1y; + access_log off; + } } } -- 2.47.2 From fca006b81b9b763e6ef82acfd22d789e4eefcdac Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 15 Aug 2023 23:47:37 +0000 Subject: [PATCH 2/2] add Plausible analytics --- src/layouts/Base.astro | 53 ++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index 2e1d94c..a334da3 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -1,25 +1,28 @@ ---- -export interface Props { - title: string -} - -import Favicon from '../components/Favicon/Favicon.astro' -import IconSVG from '../assets/layouts/Base/favicon.svg' -import IconPNG from '../assets/layouts/Base/favicon.png' - -const { title } = Astro.props; ---- - - - - - - - - - {title} - - - - - +--- +export interface Props { + title: string +} + +import Favicon from '../components/Favicon/Favicon.astro' +import IconSVG from '../assets/layouts/Base/favicon.svg' +import IconPNG from '../assets/layouts/Base/favicon.png' + +const { title } = Astro.props; +--- + + + + + + + + + + + + {title} + + + + + -- 2.47.2