mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00

* 🔈 fix: Refactor AudioRecorder to use button element for improved accessibility * 🔈 fix: Update conversation menu button ID for improved accessibility * 🔈 fix: Remove redundant role attribute from SidePanel for improved accessibility * feat: Add robots.txt to manage web crawler access * feat: Update index.html with meta description and remove legacy file * fix: resolve merge conflicts. * fix: resolve merge conflicts. * fix: resolve merge conflicts. * feat: Update index.html with meta description and remove legacy file * 🔧 feat: Add legacy support and improve SidePanel accessibility * 🔧 feat: Integrate express-static-gzip for improved static file serving and add new plugins for enhanced functionality * 🔧 chore: Remove unused HTML ESLint plugin configurations and dependencies --------- Co-authored-by: Ruben Talstra <RubenTalstra1211@outlook.com>
19 lines
643 B
JavaScript
19 lines
643 B
JavaScript
const expressStaticGzip = require('express-static-gzip');
|
|
|
|
const oneDayInSeconds = 24 * 60 * 60;
|
|
|
|
const sMaxAge = process.env.STATIC_CACHE_S_MAX_AGE || oneDayInSeconds;
|
|
const maxAge = process.env.STATIC_CACHE_MAX_AGE || oneDayInSeconds * 2;
|
|
|
|
const staticCache = (staticPath) =>
|
|
expressStaticGzip(staticPath, {
|
|
enableBrotli: false, // disable Brotli, only using gzip
|
|
orderPreference: ['gz'],
|
|
setHeaders: (res, _path) => {
|
|
if (process.env.NODE_ENV?.toLowerCase() === 'production') {
|
|
res.setHeader('Cache-Control', `public, max-age=${maxAge}, s-maxage=${sMaxAge}`);
|
|
}
|
|
},
|
|
});
|
|
|
|
module.exports = staticCache;
|