Skip to content

Commit

Permalink
feat: server cache settings for all videos
Browse files Browse the repository at this point in the history
  • Loading branch information
micksabox committed Jun 18, 2024
1 parent fa25347 commit e3c967a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ function handleBrowserRequest(

responseHeaders.set('Content-Type', 'text/html')

const url = new URL(request.url)
if (url.pathname.startsWith('/videos')) {
responseHeaders.set('Cache-Control', 'public, max-age=604800') // 1 week
}

resolve(
new Response(createReadableStreamFromReadable(body), {
headers: responseHeaders,
Expand Down

0 comments on commit e3c967a

Please sign in to comment.