mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Minify specifies maxAge.
This commit is contained in:
parent
1fe9d2a21e
commit
43f4184e8d
1 changed files with 5 additions and 0 deletions
|
@ -68,6 +68,11 @@ function _handle(req, res, jsFilename, jsFiles) {
|
||||||
date = new Date(date);
|
date = new Date(date);
|
||||||
res.setHeader('last-modified', date.toUTCString());
|
res.setHeader('last-modified', date.toUTCString());
|
||||||
res.setHeader('date', (new Date()).toUTCString());
|
res.setHeader('date', (new Date()).toUTCString());
|
||||||
|
if (server.maxAge) {
|
||||||
|
var expiresDate = new Date((new Date()).getTime() + server.maxAge*1000);
|
||||||
|
res.setHeader('expires', expiresDate.toUTCString());
|
||||||
|
res.setHeader('cache-control', 'max-age=' + server.maxAge);
|
||||||
|
}
|
||||||
|
|
||||||
fs.stat(JS_DIR + jsFiles[0], function (error, stats) {
|
fs.stat(JS_DIR + jsFiles[0], function (error, stats) {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue