myapikey 0.40.0 → 0.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myapikey",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Personal LLM API gateway & proxy — one address + one API key for all your models. Forwards OpenAI & Anthropic calls to your backends with failover and a circuit breaker. Pure passthrough, no format translation. Self-hosted (CLI + web UI).",
|
|
6
6
|
"keywords": [
|
|
@@ -59,6 +59,19 @@ export function createApp(store: Store, opts: AppOptions = {}): Hono {
|
|
|
59
59
|
|
|
60
60
|
// Web UI: serve built SPA when available.
|
|
61
61
|
if (opts.webDir && existsSync(opts.webDir)) {
|
|
62
|
+
// Cache discipline is what makes an update visible after a plain reload:
|
|
63
|
+
// index.html (any HTML response — root or SPA fallback) must always be
|
|
64
|
+
// revalidated, while /assets/* filenames are content-hashed and immutable.
|
|
65
|
+
// Without this, browsers heuristic-cache the old index.html and keep
|
|
66
|
+
// booting the previous build until a hard refresh.
|
|
67
|
+
app.use("/*", async (c, next) => {
|
|
68
|
+
await next();
|
|
69
|
+
if ((c.res.headers.get("content-type") ?? "").startsWith("text/html")) {
|
|
70
|
+
c.res.headers.set("Cache-Control", "no-cache");
|
|
71
|
+
} else if (c.req.path.startsWith("/assets/")) {
|
|
72
|
+
c.res.headers.set("Cache-Control", "public, max-age=31536000, immutable");
|
|
73
|
+
}
|
|
74
|
+
});
|
|
62
75
|
app.use("/*", serveStatic({ root: opts.webDir }));
|
|
63
76
|
app.get("*", async (c) => {
|
|
64
77
|
try {
|