File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 5
5
const FastBootAppServer = require ( 'fastboot-app-server' ) ;
6
6
const ExpressHTTPServer = require ( 'fastboot-app-server/src/express-http-server' ) ;
7
7
const parseArgs = require ( 'minimist' ) ;
8
+ const express = require ( 'express' ) ;
8
9
const { URL } = require ( 'url' ) ;
9
10
10
11
// Provide a title to the process in `ps`
@@ -26,7 +27,6 @@ if (!distPath) {
26
27
}
27
28
28
29
const serverOptions = {
29
- // assetsCacheControl: 'max-age=365000000, immutable',
30
30
distPath,
31
31
gzip : false , // Let Fastly take care of compression, reducing load on the fastboot
32
32
} ;
@@ -35,6 +35,12 @@ const httpServer = new ExpressHTTPServer(serverOptions);
35
35
36
36
const app = httpServer . app ;
37
37
38
+ app . use ( express . static ( distPath , {
39
+ setHeaders ( res , path , stat ) {
40
+ res . setHeader ( 'Cache-Control' , 'public, max-age=365000000, immutable' ) ;
41
+ }
42
+ } ) ) ;
43
+
38
44
/** We rewrite the 307 location header into a relativeURL so that our special setup is handled */
39
45
app . use ( function ( req , res , next ) {
40
46
const originalSendFn = res . send ;
You can’t perform that action at this time.
0 commit comments