Skip to content

Commit fc6d6a6

Browse files
ascorbicsarah11918yanthomasdev
authored
Remove maxAge from live collection docs (withastro#12571)
Co-authored-by: Sarah Rainsberger <[email protected]> Co-authored-by: yanthomasdev <[email protected]>
1 parent 18b407a commit fc6d6a6

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/content/docs/en/reference/experimental-flags/live-content-collections.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,9 @@ export function myLoader(config): LiveLoader<MyData> {
555555
cacheHint: {
556556
// All fields are optional, and are combined with each entry's cache hints
557557
// tags are merged from all entries
558-
// maxAge is the shortest maxAge of all entries and the collection
559558
// lastModified is the most recent lastModified of all entries and the collection
560559
lastModified: new Date(item.lastModified),
561560
tags: ['products'],
562-
maxAge: 300, // 5 minutes
563561
},
564562
};
565563
},
@@ -571,7 +569,6 @@ export function myLoader(config): LiveLoader<MyData> {
571569
cacheHint: {
572570
lastModified: new Date(item.lastModified),
573571
tags: [`product-${item.id}`, `category-${item.category}`],
574-
maxAge: 3600, // 1 hour
575572
},
576573
};
577574
},
@@ -597,9 +594,6 @@ if (error) {
597594
if (cacheHint?.tags) {
598595
Astro.response.headers.set('Cache-Tag', cacheHint.tags.join(','));
599596
}
600-
if (cacheHint?.maxAge) {
601-
Astro.response.headers.set('Cache-Control', `s-maxage=${cacheHint.maxAge}`);
602-
}
603597
if (cacheHint?.lastModified) {
604598
Astro.response.headers.set('Last-Modified', cacheHint.lastModified.toUTCString());
605599
}

0 commit comments

Comments
 (0)