-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
64 lines (52 loc) · 2.08 KB
/
compose.yml
File metadata and controls
64 lines (52 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
services:
website:
build:
context: .
dockerfile: Dockerfile
networks:
- caddy
restart: unless-stopped
labels:
caddy: clauzier.dev
caddy.reverse_proxy: "{{upstreams 80}}"
# Advanced caching and compression
caddy.header: |
# Static assets with content hashing - Long cache
Cache-Control "public, max-age=31536000, immutable" /_astro/*
# Images - Long cache
Cache-Control "public, max-age=31536000, immutable" /*.{jpg,jpeg,png,gif,ico,svg,webp,avif}
Cache-Control "public, max-age=31536000, immutable" /images/*
# Fonts - Very long cache with CORS
Cache-Control "public, max-age=31536000, immutable" /*.{woff2,woff,ttf,eot}
Access-Control-Allow-Origin "*" /*.{woff2,woff,ttf,eot}
# CSS/JS - Long cache
Cache-Control "public, max-age=31536000, immutable" /*.{css,js}
# HTML pages - Short cache with revalidation
Cache-Control "public, max-age=300, s-maxage=3600, stale-while-revalidate=86400" /*.html
Cache-Control "public, max-age=300, s-maxage=3600, stale-while-revalidate=86400" /
# Dynamic content
Cache-Control "public, max-age=3600, s-maxage=7200, stale-while-revalidate=86400" /rss.xml
Cache-Control "public, max-age=3600, s-maxage=7200, stale-while-revalidate=86400" /sitemap*.xml
# Service Worker - No cache
Cache-Control "no-cache, no-store, must-revalidate" /sw.js
# Add ETag for all resources
ETag "strong"
# Vary header for compression
Vary "Accept-Encoding, Accept"
# Enable advanced compression
caddy.encode: "gzip zstd"
# Enable HTTP/2 Push for critical resources
caddy.push: |
/*.html /_astro/*.css
/*.html /_astro/*.js
www_redirect:
image: caddy:latest
restart: unless-stopped
networks:
- caddy
labels:
caddy: www.clauzier.dev
caddy.redir: "https://clauzier.dev{uri} 301"
networks:
caddy:
external: true