Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(seo): Add proper cache headers for blog pages

Lindsay Liue5f0319c4c0a
diff --git a/src/web/public/_headers b/src/web/public/_headers
new file mode 100644
index 000000000..da2eec5cf
--- /dev/null
+++ b/src/web/public/_headers
@@ -0,0 +1,30 @@
+# Cache control headers for SEO optimization
+
+# Blog pages - cache for 1 hour, allow CDN to cache but revalidate
+/blog/*
+ Cache-Control: public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400
+
+# Static assets - cache for 1 year
+/_next/static/*
+ Cache-Control: public, max-age=31536000, immutable
+
+# Images and media - cache for 1 month
+/images/*
+ Cache-Control: public, max-age=2592000
+
+/gallery/*
+ Cache-Control: public, max-age=2592000
+
+# Homepage - cache for 15 minutes
+/
+ Cache-Control: public, max-age=900, s-maxage=900, stale-while-revalidate=3600
+
+# API routes - no cache
+/api/*
+ Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate
+ Pragma: no-cache
+ Expires: 0
+
+# Default for HTML pages - cache for 5 minutes
+/*
+ Cache-Control: public, max-age=300, s-maxage=300, stale-while-revalidate=3600
\ No newline at end of file