remove debug loggings

This commit is contained in:
2026-03-18 04:41:57 +08:00
parent 8b9fc94874
commit f7e3124797
3 changed files with 26 additions and 23 deletions
+22 -1
View File
@@ -293,5 +293,26 @@ All database queries use parameterized statements (`?` placeholders).
`nginx.conf` contains **location blocks only** — drop them into an existing `server { }` block. Adjust the `alias` paths to match your deployment layout.
When running without nginx (Docker Compose or local dev), the Python backend serves the frontend directly at the base URL.
When running without nginx (Docker Compose or local dev), the Python backend serves the frontend directly at the base URL. Set `"production": true` in config to disable backend static serving (nginx handles it).
### Caching strategy
The nginx config uses a layered caching strategy designed for deployments behind Cloudflare or other CDNs:
| Resource | `Cache-Control` | Why |
|---|---|---|
| `/s/` (index.html) | `no-store` | Never cached by CDN or browser. This is the HTML entry point (~2KB) that contains `?v=` cache-buster query strings for CSS/JS. Must always be fresh so that version bumps take effect immediately. |
| `/s/static/*.css?v=…` | `no-cache` | Cached but revalidated on each request. The `?v=` query string acts as a cache key — Cloudflare and browsers treat each version as a distinct resource. Bump the `?v=` value in `index.html` whenever CSS/JS files change. |
| `/s/static/*.js?v=…` | `no-cache` | Same as CSS. |
| `/s/api/*`, `/s/<code>` | (proxied) | Not cached by nginx; backend controls caching via response headers. |
### Updating static files
When you modify `style.css` or `app.js`:
1. Deploy the updated files to the server
2. Bump the `?v=` value in `static/index.html` (e.g. `?v=20260318``?v=20260319`)
3. Reload nginx (`nginx -s reload`)
Since `index.html` has `no-store`, browsers and Cloudflare always fetch the latest version, which in turn references the new `?v=` URLs for CSS/JS — busting all downstream caches automatically. No manual CDN purge is needed.