[web] add support for pug caching when running E2E tests in dev-env (#27073)

GitOrigin-RevId: bbb53723bd1bc22db5b3d440539f1624a905341f
This commit is contained in:
Jakob Ackermann
2025-07-15 18:48:48 +02:00
committed by Copybot
parent 812a2704fa
commit 984171bf2f
2 changed files with 5 additions and 2 deletions

View File

@@ -134,7 +134,7 @@ app.set('views', fileURLToPath(new URL('../../views', import.meta.url)))
app.set('view engine', 'pug')
if (Settings.enabledServices.includes('web')) {
if (app.get('env') !== 'development') {
if (Settings.enablePugCache || app.get('env') !== 'development') {
logger.debug('enabling view cache for production or acceptance tests')
app.enable('view cache')
}

View File

@@ -807,7 +807,10 @@ module.exports = {
'/templates/index': '/templates/',
},
reloadModuleViewsOnEachRequest: process.env.NODE_ENV === 'development',
enablePugCache: process.env.ENABLE_PUG_CACHE === 'true',
reloadModuleViewsOnEachRequest:
process.env.ENABLE_PUG_CACHE !== 'true' &&
process.env.NODE_ENV === 'development',
rateLimit: {
subnetRateLimiterDisabled: