-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathroutes.js
46 lines (42 loc) · 1.04 KB
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// This file was added by edgio init.
// You should commit this file to source control.
import { Router, edgioRoutes } from '@edgio/core/router';
export default new Router()
.use(edgioRoutes)
.match(':path', {
origin: {
set_origin: 'origin',
},
})
// caching stylesheets and scripts
.match('/:path*/:file.:ext(js|mjs|css)', {
headers: {
set_response_headers: {
'cache-control': 'public, max-age=86400',
},
remove_origin_response_headers: ['set-cookie'],
},
caching: {
ignore_origin_no_cache: [200],
bypass_client_cache: true,
},
origin: {
set_origin: 'origin',
},
})
// caching assets
.match('/:path*/:file.:ext(png|ico|svg|jpg|jpeg|gif|ttf|woff|otf)', {
headers: {
set_response_headers: {
'cache-control': 'public, max-age=86400',
},
remove_origin_response_headers: ['set-cookie'],
},
caching: {
ignore_origin_no_cache: [200],
bypass_client_cache: true,
},
origin: {
set_origin: 'origin',
},
});