Skip to content

Commit 9977f31

Browse files
authored
repo sync
2 parents 16bb1aa + 3600e4d commit 9977f31

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

middleware/render-page.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ module.exports = async function renderPage (req, res, next) {
1515
const originalUrl = req.originalUrl
1616

1717
// Serve from the cache if possible
18-
if (req.method === 'GET' && pageCache[originalUrl]) {
19-
console.log(`Serving from cached version of ${originalUrl}`)
20-
return res.send(pageCache[originalUrl])
18+
if (!process.env.CI) {
19+
if (req.method === 'GET' && pageCache[originalUrl]) {
20+
console.log(`Serving from cached version of ${originalUrl}`)
21+
return res.send(pageCache[originalUrl])
22+
}
2123
}
2224

2325
// render a 404 page
@@ -86,8 +88,10 @@ module.exports = async function renderPage (req, res, next) {
8688
const output = await liquid.parseAndRender(layout, context)
8789

8890
// Save output to cache for the next time around
89-
if (req.method === 'GET') {
90-
pageCache[originalUrl] = output
91+
if (!process.env.CI) {
92+
if (req.method === 'GET') {
93+
pageCache[originalUrl] = output
94+
}
9195
}
9296

9397
// send response

0 commit comments

Comments
 (0)