Files
davila7__claude-code-templates/dashboard/public/_headers
daniel 41cbbea00c perf(dashboard): reducir payload del home 87% y restaurar caching en Cloudflare
- Split components.json: índice sin content (1.9 MB / 249 KB br vs 15.6 MB / 4.15 MB br).
  Generador produce component-content/{type}/{slug}.json por componente y auto-copia
  a dashboard/public/. Página de detalle carga contenido on-demand via fetchComponentContent().
- Restaurar cabeceras de caché y seguridad perdidas en la migración Vercel→Cloudflare:
  _headers con Cache-Control max-age=86400 para JSONs, immutable para _astro/*,
  y HSTS, X-Frame-Options, Referrer-Policy, Permissions-Policy en todas las rutas.
- Eliminar dashboard/vercel.json (config muerta desde migración a Cloudflare Pages).
- Diferir hidratación: ClerkIsland y AuthButton client:load → client:idle;
  SaveToCollectionButton → client:visible.
- Eliminar gpt-tokenizer del bundle del navegador: reemplazado por estimación chars/4.
- Actualizar .claude/rules/dashboard.md para reflejar hosting en Cloudflare Pages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 16:58:13 -04:00

38 lines
1.2 KiB
Plaintext

# Static JSON data — cached 24h at the edge, revalidated on deploy
/components.json
Cache-Control: public, max-age=86400, stale-while-revalidate=3600
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
/component-content/*
Cache-Control: public, max-age=86400, stale-while-revalidate=3600
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
/plugins.json
Cache-Control: public, max-age=86400, stale-while-revalidate=3600
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
/trending-data.json
Cache-Control: public, max-age=3600, stale-while-revalidate=300
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
/claude-jobs.json
Cache-Control: public, max-age=3600, stale-while-revalidate=300
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
# Astro hashed assets — immutable forever (hash changes on content change)
/_astro/*
Cache-Control: public, max-age=31536000, immutable
# Security headers — applied to all routes
/*
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Referrer-Policy: strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
Permissions-Policy: camera=(), microphone=(), geolocation=()