cache static files for webserver
This commit is contained in:
parent
78d4efd8f3
commit
f0cd159235
1 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,12 @@ app.use(logger());
|
|||
app.use(cacheControlMiddleware);
|
||||
app.use(redirectMiddleware);
|
||||
app.use(iframeDestroyerMiddleware);
|
||||
|
||||
// Check if the request url matches any assets inside of /dist
|
||||
app.use(serve(DIST_ROOT, {
|
||||
maxage: 3600000, // set a cache time of one hour, helpful for mobile dev
|
||||
}));
|
||||
|
||||
app.use(serve(DIST_ROOT)); // Check if the request url matches any assets inside of /dist
|
||||
|
||||
app.use(router.routes());
|
||||
|
|
Loading…
Reference in a new issue