Skip to content

Commit

Permalink
Add caching
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlee85 committed Aug 23, 2023
1 parent 0df5e91 commit 06e5ea9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions examples/v7-remix/routes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// This file was automatically added by edgio init.
// You should commit this file to source control.
import { Router } from '@edgio/core'
import type { Features } from '@edgio/core/types';

const defaultFeatures: Features = {
caching: {
max_age: '1d',
stale_while_revalidate: '1d',
service_worker_max_age: '1h',
},
};

export default new Router()
.match('/:path*', {
origin: {
set_origin: 'edgio_serverless',
},
})
.static('public')
.match('/(.*)', defaultFeatures)
.match('/:path*', ({ renderWithApp }) => renderWithApp())
.static('public');

0 comments on commit 06e5ea9

Please sign in to comment.