mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
fix: keepAlive, ,add some cache time to "static" img
This commit is contained in:
parent
ecab6d4821
commit
63086de9f0
4 changed files with 18 additions and 6 deletions
|
@ -104,6 +104,12 @@ module.exports = {
|
|||
skipSettingLocaleOnNavigate: true,
|
||||
},
|
||||
|
||||
render: {
|
||||
static: {
|
||||
maxAge: "6000000"
|
||||
}
|
||||
},
|
||||
|
||||
serverMiddleware: ['server/routes'],
|
||||
|
||||
/*
|
||||
|
@ -147,6 +153,12 @@ module.exports = {
|
|||
defaultAssets: false,
|
||||
optionsPath: './vuetify.options.js'
|
||||
},
|
||||
hooks: {
|
||||
listen(server) {
|
||||
server.keepAliveTimeout = 35000;
|
||||
server.headersTimeout = 36000;
|
||||
}
|
||||
},
|
||||
build: {
|
||||
extend(config, { isDev, isClient }) {
|
||||
// ..
|
||||
|
|
|
@ -219,7 +219,7 @@ const instancesController = {
|
|||
// search for actor url
|
||||
const actorURL = webfinger?.links.find(l => l.rel === 'self').href
|
||||
|
||||
// retrieve the AP actor and flat it as trusted
|
||||
// retrieve the AP actor and flag it as trusted
|
||||
const actor = await getActor(actorURL, instance)
|
||||
await actor.update({ trusted: true })
|
||||
return res.json(actor)
|
||||
|
|
|
@ -35,7 +35,7 @@ const resourceController = {
|
|||
hidden: r.hidden,
|
||||
created: r.createdAt,
|
||||
data: {
|
||||
content: r.data.content
|
||||
content: r.data?.content
|
||||
},
|
||||
event: {
|
||||
id: r.event.id,
|
||||
|
|
|
@ -126,22 +126,22 @@ module.exports = {
|
|||
|
||||
router.use('/fallbackimage.png', (req, res, next) => {
|
||||
const fallbackImagePath = settingsController.settings.fallback_image || './static/noimg.svg'
|
||||
return express.static(fallbackImagePath)(req, res, next)
|
||||
return express.static(fallbackImagePath, { maxAge: '10m' })(req, res, next)
|
||||
})
|
||||
|
||||
router.use('/headerimage.png', (req, res, next) => {
|
||||
const headerImagePath = settingsController.settings.header_image || './static/noimg.svg'
|
||||
return express.static(headerImagePath)(req, res, next)
|
||||
return express.static(headerImagePath, { maxAge: '10m' })(req, res, next)
|
||||
})
|
||||
|
||||
router.use('/logo.png', (req, res, next) => {
|
||||
const logoPath = settingsController.settings.logo || './static/gancio'
|
||||
return express.static(logoPath + '.png')(req, res, next)
|
||||
return express.static(logoPath + '.png', { maxAge: '10m' } )(req, res, next)
|
||||
})
|
||||
|
||||
router.use('/favicon.ico', (req, res, next) => {
|
||||
const faviconPath = res.locals.settings.logo ? res.locals.settings.logo + '.png' : './assets/favicon.ico'
|
||||
return express.static(faviconPath)(req, res, next)
|
||||
return express.static(faviconPath, { maxAge: '10m' })(req, res, next)
|
||||
})
|
||||
|
||||
return router
|
||||
|
|
Loading…
Reference in a new issue