Add cache parameter
This commit is contained in:
@@ -22,6 +22,7 @@ import { serve_font } from './serve_font.js';
|
||||
import { getTileUrls, getPublicUrl } from './utils.js';
|
||||
|
||||
import { fileURLToPath } from 'url';
|
||||
import nocache from 'nocache';
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const packageJson = JSON.parse(
|
||||
@@ -83,6 +84,13 @@ function start(opts) {
|
||||
}
|
||||
|
||||
const options = config.options || {};
|
||||
|
||||
const cacheFlag = options.cache || false;
|
||||
if (!cacheFlag) {
|
||||
console.log('Cache disabled');
|
||||
app.use(nocache());
|
||||
}
|
||||
|
||||
const paths = options.paths || {};
|
||||
options.paths = paths;
|
||||
paths.root = path.resolve(
|
||||
|
||||
Reference in New Issue
Block a user