@fangorn-network/westmarch 0.0.7-dev → 0.0.8-dev
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 +1 -1
- package/site/worker.js +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fangorn-network/westmarch",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8-dev",
|
|
4
4
|
"description": "Publisher and consumer surfaces for a Fangorn app: shape a graph, publish it, read it back as a searchable, agent-drivable catalog",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/site/worker.js
CHANGED
|
@@ -94,10 +94,12 @@ export default {
|
|
|
94
94
|
const p = url.pathname;
|
|
95
95
|
if (p === "/.well-known/agent-card.json" || p.startsWith("/view/")) out.headers.set("access-control-allow-origin", "*");
|
|
96
96
|
if (p.startsWith("/assets/")) out.headers.set("cache-control", "public, max-age=31536000, immutable");
|
|
97
|
-
// Shards are content-named,
|
|
98
|
-
// pages.dev's edge cache cannot be purged
|
|
97
|
+
// Shards are content-named, so a reader's browser keeps one for good: a change or a
|
|
98
|
+
// retraction writes new names. `private`: pages.dev's edge cache cannot be purged, so it
|
|
99
|
+
// must never hold one, and a retracted record's shard stops being served when the deploy
|
|
100
|
+
// drops it. (This worker's header wins over _headers, which Pages skips for worker responses.)
|
|
99
101
|
else if (/^\/view\/cdn\/domains\/[^/]+\/shards\//.test(p))
|
|
100
|
-
out.headers.set("cache-control", (res.headers.get("content-type") ?? "").includes("html") ? "no-store" : "
|
|
102
|
+
out.headers.set("cache-control", (res.headers.get("content-type") ?? "").includes("html") ? "no-store" : "private, max-age=31536000, immutable");
|
|
101
103
|
return out;
|
|
102
104
|
},
|
|
103
105
|
};
|