Title here
Summary here
Démarrez un petit serveur d’origine :
mkdir -p /tmp/bouine-origin
printf 'hello from origin\n' > /tmp/bouine-origin/index.html
python3 -m http.server 3000 --directory /tmp/bouine-originCréez config.yaml :
listen:
http: ":8080"
admin: ":9000"
storage:
hot_max_bytes: 256Mo
upstream_pools:
- name: origin
targets: ["127.0.0.1:3000"]
routes:
- match: { path_prefix: / }
pool: origin
cache:
ttl_default: 60s
stale_while_revalidate: 10s
stale_if_error: 300sExécutez bouine :
bouine serve --config config.yaml --log-format jsonVérifiez la mise en cache :
curl -sI http://127.0.0.1:8080/ | grep X-Cache
# X-Cache: MISS
curl -sI http://127.0.0.1:8080/ | grep X-Cache
# X-Cache: HITVérifiez la santé et les métriques :
curl -s http://127.0.0.1:9000/healthz
curl -s http://127.0.0.1:9000/readyz
curl -s http://127.0.0.1:9000/metrics | grep bouine_requests_totalX-Cache: HIT et le journal d’accès incluait cache_status=HIT.bouine peut servir des fichiers directement depuis un répertoire local — pas besoin d’exécuter un serveur HTTP distinct. Voir Servir des fichiers statiques pour la référence complète.
mkdir -p /tmp/bouine-static
printf 'hello from disk\n' > /tmp/bouine-static/index.htmlCréez config.yaml :
listen:
http: ":8080"
admin: ":9000"
routes:
- match: { path_prefix: / }
static:
root: /tmp/bouine-static
index: [index.html]Exécutez bouine :
bouine serve --config config.yaml --log-format jsoncurl -sI http://127.0.0.1:8080/ | grep Content-Type
# Content-Type: text/html; charset=utf-8Les routes statiques servent depuis le disque à chaque requête. Le cache de pages
de l’OS gère la mise en cache chaude en RAM. Pour activer la couche de cache de
bouine (pour la réplication en cluster ou l’éviction basée sur le TTL), définissez
cache.enabled: true sur la route.