Skip to content

Commit fcf98e5

Browse files
committed
add Cache-Control header
1 parent d4725d2 commit fcf98e5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

api/server.js

+10
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var Server = function (options) {
2727
app.use(filterDuplicateQueryParams);
2828
app.use(favicon(__dirname + '/favicon.png'));
2929
app.use(compression());
30+
app.use(cacheControl);
3031

3132
// deprecated v1 routes
3233
app.get('/v1/accounts/:address/transactions', map.deprecated);
@@ -109,6 +110,15 @@ var Server = function (options) {
109110
};
110111
};
111112

113+
114+
/**
115+
* cacheControl
116+
*/
117+
function cacheControl(req, res, next) {
118+
res.setHeader('Cache-Control', 'max-age=2');
119+
next();
120+
}
121+
112122
/**
113123
* filterDuplicateQueryParams
114124
* NOTE: this only works if we dont pass

0 commit comments

Comments
 (0)