forked from mirror/MCSManager
Feat: cache static files
This commit is contained in:
parent
160a4e293b
commit
49cb682d48
@ -164,7 +164,10 @@ _ / / / / /___ ____/ /_ / / / / /_/ /_ / / / /_/ /_ /_/ // __/ /
|
||||
app.use(protocolMiddleware);
|
||||
|
||||
// static file routing
|
||||
app.use(koaStatic(path.join(BASE_PATH, "public")));
|
||||
const koaStaticOptions = {
|
||||
maxAge: 10 * 24 * 60 * 60 //Cache for ten days. Changed files will not be load from cache.
|
||||
};
|
||||
app.use(koaStatic(path.join(BASE_PATH, "public"), koaStaticOptions));
|
||||
|
||||
// Websocket routing (useless for now)
|
||||
// import SocketService from "./app/service/socket_service";
|
||||
|
Loading…
Reference in New Issue
Block a user