@vizamodo/edge-cache-core 0.3.33 → 0.3.34

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.
@@ -75,8 +75,12 @@ export async function setEdgeCache(key, value, ttlSec) {
75
75
  });
76
76
  try {
77
77
  console.debug("[edge-cache] SET BODY SIZE", { key, size: body.length });
78
+ const t0 = Date.now();
78
79
  await cache.put(req, res);
79
- console.debug("[edge-cache] SET OK", { key });
80
+ // Force event loop flush to ensure write completes before worker exits
81
+ await new Promise((r) => setTimeout(r, 0));
82
+ const t1 = Date.now();
83
+ console.debug("[edge-cache] SET OK", { key, durationMs: t1 - t0 });
80
84
  }
81
85
  catch (err) {
82
86
  console.error("[edge-cache] SET FAILED", { key, err });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizamodo/edge-cache-core",
3
- "version": "0.3.33",
3
+ "version": "0.3.34",
4
4
  "description": "Edge cache primitives for Cloudflare Workers (L1 memory + L2 edge cache)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",