mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #19777 from overleaf/bg-issue19430-implement-wiki-caching
support conditional requests for learn wiki images GitOrigin-RevId: fb77ab632c325f88dfed1624a5abad8f2e52ee3d
This commit is contained in:
parent
d78f7a3b19
commit
cb2434d29c
1 changed files with 6 additions and 0 deletions
|
@ -297,6 +297,12 @@ webRouter.use(function addNoCacheHeader(req, res, next) {
|
|||
return next()
|
||||
}
|
||||
|
||||
const isWikiContent = /^\/learn(-scripts)?(\/|$)/i.test(req.path)
|
||||
if (isWikiContent) {
|
||||
// don't set no-cache headers on wiki content, as it's immutable and can be cached (publicly)
|
||||
return next()
|
||||
}
|
||||
|
||||
const isLoggedIn = SessionManager.isUserLoggedIn(req.session)
|
||||
if (isLoggedIn) {
|
||||
// always set no-cache headers for authenticated users (apart from project files, above)
|
||||
|
|
Loading…
Reference in a new issue