Skip to content

Commit 5807d4e

Browse files
add cache headers
Co-Authored-By: fuko <43729152+fulopkovacs@users.noreply.github.com>
1 parent 0014da8 commit 5807d4e

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/routes/$libraryId/$version.docs.framework.$framework.{$}[.]md.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export const ServerRoute = createServerFileRoute().methods({
2424
headers: {
2525
'Content-Type': 'text/markdown',
2626
'Content-Disposition': `inline; filename="${filename}.md"`,
27+
'Cache-Control': 'public, max-age=0, must-revalidate',
28+
'Cdn-Cache-Control': 'max-age=300, stale-while-revalidate=300, durable',
2729
},
2830
})
2931
},

src/routes/$libraryId/$version.docs.{$}[.]md.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export const ServerRoute = createServerFileRoute().methods({
2424
headers: {
2525
'Content-Type': 'text/markdown',
2626
'Content-Disposition': `inline; filename="${filename}.md"`,
27+
'Cache-Control': 'public, max-age=0, must-revalidate',
28+
'Cdn-Cache-Control': 'max-age=300, stale-while-revalidate=300, durable',
2729
},
2830
})
2931
},

0 commit comments

Comments
 (0)