@cloudflare/pages-shared 0.11.33 → 0.11.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.
- package/asset-server/handler.ts +3 -10
- package/package.json +2 -2
package/asset-server/handler.ts
CHANGED
|
@@ -480,13 +480,6 @@ export async function generateHandler<
|
|
|
480
480
|
|
|
481
481
|
return await attachHeaders(await generateResponse());
|
|
482
482
|
|
|
483
|
-
/** We have non-standard cache behavior, so strip out all headers but keep the method */
|
|
484
|
-
function getCacheKey(): Request {
|
|
485
|
-
return new Request(request.url, {
|
|
486
|
-
method: request.method,
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
|
|
490
483
|
async function serveAsset(
|
|
491
484
|
servingAssetEntry: AssetEntry,
|
|
492
485
|
options = { preserve: true }
|
|
@@ -580,7 +573,7 @@ export async function generateHandler<
|
|
|
580
573
|
preservedResponse.headers.set("x-robots-tag", "noindex");
|
|
581
574
|
|
|
582
575
|
await assetPreservationCacheV2.put(
|
|
583
|
-
|
|
576
|
+
request.url,
|
|
584
577
|
preservedResponse
|
|
585
578
|
);
|
|
586
579
|
}
|
|
@@ -621,12 +614,12 @@ export async function generateHandler<
|
|
|
621
614
|
ASSET_PRESERVATION_CACHE_V2
|
|
622
615
|
);
|
|
623
616
|
let preservedResponse = await assetPreservationCacheV2.match(
|
|
624
|
-
|
|
617
|
+
request.url
|
|
625
618
|
);
|
|
626
619
|
|
|
627
620
|
// Continue serving from V1 preservation cache for some time to
|
|
628
621
|
// prevent 404s during the migration to V2
|
|
629
|
-
const cutoffDate = new Date("2024-05-
|
|
622
|
+
const cutoffDate = new Date("2024-05-17");
|
|
630
623
|
if (!preservedResponse && Date.now() < cutoffDate.getTime()) {
|
|
631
624
|
const assetPreservationCacheV1 = await caches.open(
|
|
632
625
|
ASSET_PRESERVATION_CACHE_V1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/pages-shared",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.34",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/cloudflare/workers-sdk.git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"metadata-generator/**/*"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"miniflare": "3.20240419.
|
|
16
|
+
"miniflare": "3.20240419.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@miniflare/storage-memory": "^2.14.2",
|