[object Object]

← back to AsSeenInMovies

asseeninmovies: /api/spotted/stats Cache-Control max-age=30 SWR=60

f78067e9534139c13a16f2cd628e8504c4190985 · 2026-05-12 22:54:21 -0700 · SteveStudio2

Files touched

Diff

commit f78067e9534139c13a16f2cd628e8504c4190985
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Tue May 12 22:54:21 2026 -0700

    asseeninmovies: /api/spotted/stats Cache-Control max-age=30 SWR=60
---
 server.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server.js b/server.js
index 6acd32e..8911399 100644
--- a/server.js
+++ b/server.js
@@ -699,6 +699,9 @@ app.get('/api/spotted', async (req, res) => {
 // render, exposed as a single small API. Useful for the status-loop tail
 // monitor and any external dashboard. No auth needed — public counts only.
 app.get('/api/spotted/stats', async (_req, res) => {
+  // Short Cache-Control — stats don't change second-to-second. 30s lets
+  // crawlers/dashboards/status-loop poll without hammering pg.
+  res.setHeader('Cache-Control', 'public, max-age=30, stale-while-revalidate=60');
   try {
     const r = await pool.query(`
       SELECT

← 9f98777 asseeninmovies: GA4 gtag wiring (env-gated via GA_ID) on bot  ·  back to AsSeenInMovies  ·  asseeninmovies: /api/{movie,person,search,spotted} Cache-Con 7197fa3 →