fix: Increase browser cache time for attachment files

This commit is contained in:
Maksim Eltyshev
2025-09-16 17:35:05 +02:00
parent 97ddefc236
commit 709dd91e82
2 changed files with 2 additions and 2 deletions

View File

@@ -86,7 +86,7 @@ module.exports = {
} }
this.res.type(attachment.data.mimeType); this.res.type(attachment.data.mimeType);
this.res.set('Cache-Control', 'private, max-age=900'); // TODO: move to config this.res.set('Cache-Control', 'private, max-age=86400, no-transform'); // TODO: move to config
return exits.success(readStream); return exits.success(readStream);
}, },

View File

@@ -84,7 +84,7 @@ module.exports = {
if (!INLINE_MIME_TYPES_SET.has(attachment.data.mimeType) && !attachment.data.image) { if (!INLINE_MIME_TYPES_SET.has(attachment.data.mimeType) && !attachment.data.image) {
this.res.set('Content-Disposition', 'attachment'); this.res.set('Content-Disposition', 'attachment');
} }
this.res.set('Cache-Control', 'private, max-age=900'); // TODO: move to config this.res.set('Cache-Control', 'private, max-age=86400, no-transform'); // TODO: move to config
return exits.success(readStream); return exits.success(readStream);
}, },