mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
Updated caching policy for /members/api/site
refs https://github.com/TryGhost/Team/issues/1240 As this endpoint is hit on every page load when Portal is enabled, it can cause a lot of traffic to Ghost. The data does not change very frequently so we've added a 30s cache policy to alleviate load on servers.
This commit is contained in:
parent
76b33b6e77
commit
5d8f491823
@ -38,7 +38,7 @@ module.exports = function setupMembersApp() {
|
||||
membersApp.get('/api/session', middleware.getIdentityToken);
|
||||
membersApp.get('/api/offers/:id', middleware.getOfferData);
|
||||
membersApp.delete('/api/session', middleware.deleteSession);
|
||||
membersApp.get('/api/site', middleware.getMemberSiteData);
|
||||
membersApp.get('/api/site', shared.middleware.cacheControl('public', {maxAge: 30}), middleware.getMemberSiteData);
|
||||
|
||||
// NOTE: this is wrapped in a function to ensure we always go via the getter
|
||||
membersApp.post('/api/send-magic-link', bodyParser.json(), shared.middleware.brute.membersAuth, (req, res, next) => membersService.api.middleware.sendMagicLink(req, res, next));
|
||||
|
Loading…
Reference in New Issue
Block a user