Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,9 @@ export function myLoader(config): LiveLoader<MyData> {
cacheHint: {
// 모든 필드는 선택 사항이며, 각 항목의 캐시 힌트와 결합됩니다.
// 태그는 모든 항목에서 병합됩니다.
// maxAge는 모든 항목과 컬렉션 중에서 가장 짧은 maxAge입니다.
// lastModified는 모든 항목과 컬렉션 중에서 가장 최근의 lastModified입니다.
lastModified: new Date(item.lastModified),
tags: ['products'],
maxAge: 300, // 5분
},
};
},
Expand All @@ -571,7 +569,6 @@ export function myLoader(config): LiveLoader<MyData> {
cacheHint: {
lastModified: new Date(item.lastModified),
tags: [`product-${item.id}`, `category-${item.category}`],
maxAge: 3600, // 1시간
},
};
},
Expand All @@ -597,9 +594,6 @@ if (error) {
if (cacheHint?.tags) {
Astro.response.headers.set('Cache-Tag', cacheHint.tags.join(','));
}
if (cacheHint?.maxAge) {
Astro.response.headers.set('Cache-Control', `s-maxage=${cacheHint.maxAge}`);
}
if (cacheHint?.lastModified) {
Astro.response.headers.set('Last-Modified', cacheHint.lastModified.toUTCString());
}
Expand Down