Skip to content

Commit

Permalink
add Cache-Control header
Browse files Browse the repository at this point in the history
  • Loading branch information
shekenahglory committed Dec 11, 2015
1 parent d4725d2 commit fcf98e5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var Server = function (options) {
app.use(filterDuplicateQueryParams);
app.use(favicon(__dirname + '/favicon.png'));
app.use(compression());
app.use(cacheControl);

// deprecated v1 routes
app.get('/v1/accounts/:address/transactions', map.deprecated);
Expand Down Expand Up @@ -109,6 +110,15 @@ var Server = function (options) {
};
};


/**
* cacheControl
*/
function cacheControl(req, res, next) {
res.setHeader('Cache-Control', 'max-age=2');
next();
}

/**
* filterDuplicateQueryParams
* NOTE: this only works if we dont pass
Expand Down

0 comments on commit fcf98e5

Please sign in to comment.