diff --git a/ghost/core/core/frontend/web/middleware/static-theme.js b/ghost/core/core/frontend/web/middleware/static-theme.js index af07bc3e6c..4066c92a1d 100644 --- a/ghost/core/core/frontend/web/middleware/static-theme.js +++ b/ghost/core/core/frontend/web/middleware/static-theme.js @@ -32,6 +32,8 @@ function forwardToExpressStatic(req, res, next) { const configMaxAge = config.get('caching:theme:maxAge'); + // @NOTE: the maxAge config passed below are in milliseconds and the config + // is specified in seconds. See https://github.com/expressjs/serve-static/issues/150 for more context express.static(themeEngine.getActive().path, { maxAge: (configMaxAge || configMaxAge === 0) ? configMaxAge : constants.ONE_YEAR_MS } diff --git a/ghost/core/core/server/web/admin/app.js b/ghost/core/core/server/web/admin/app.js index 43fe923acc..f7cb88766b 100644 --- a/ghost/core/core/server/web/admin/app.js +++ b/ghost/core/core/server/web/admin/app.js @@ -20,6 +20,8 @@ module.exports = function setupAdminApp() { // @NOTE: when we start working on HTTP/3 optimizations the immutable headers // produced below should be split into separate 'Cache-Control' entry. // For reference see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#validation_2 + // @NOTE: the maxAge config passed below are in milliseconds and the config + // is specified in seconds. See https://github.com/expressjs/serve-static/issues/150 for more context adminApp.use('/assets', serveStatic( path.join(config.get('paths').adminAssets, 'assets'), { maxAge: (configMaxAge || configMaxAge === 0) ? configMaxAge : constants.ONE_YEAR_MS,