Set gitter Cache-Control max-age to 50

For debugging purposes for CloudFlare.
This commit is contained in:
Thaddee Tyl 2016-05-10 20:03:53 +02:00
parent 6650f5a555
commit be5a9eef48

View File

@ -276,7 +276,7 @@ function cache(f) {
if (!cachedVersionSent) { if (!cachedVersionSent) {
badge(badgeData, makeSend(format, ask.res, end)); badge(badgeData, makeSend(format, ask.res, end));
} }
}, cachedRequest); }, cachedRequest, ask); // ask is here for debugging reasons for CloudFlare. See gitter badge.
}); });
}; };
} }
@ -4838,7 +4838,7 @@ cache(function(data, match, sendBadge, request) {
// Gitter room integration. // Gitter room integration.
camp.route(/^\/gitter\/room\/([^\/]+\/[^\/]+)\.(svg|png|gif|jpg|json)$/, camp.route(/^\/gitter\/room\/([^\/]+\/[^\/]+)\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) { cache(function(data, match, sendBadge, request, ask) {
var userRepo = match[1]; var userRepo = match[1];
var format = match[2]; var format = match[2];
@ -4849,6 +4849,7 @@ cache(function(data, match, sendBadge, request) {
badgeData.logo = badgeData.logo || logos['gitter-white']; badgeData.logo = badgeData.logo || logos['gitter-white'];
badgeData.logoWidth = 9; badgeData.logoWidth = 9;
} }
ask.res.setHeader('Cache-Control', 'max-age=50');
sendBadge(format, badgeData); sendBadge(format, badgeData);
})); }));