gdg-x / hub

[DEPRECATED] API Data Hub for the Global GDG Community
https://hub.gdgx.io
Apache License 2.0
36 stars 19 forks source link

Remove Redis and configure Edge caching #104

Closed Splaktar closed 7 years ago

Splaktar commented 7 years ago

Redis is too much of a problem. If we can get onto GAE Flex via #100, then we can just use managed Memcache instead. But for now, we don't actually need this level of caching and should just use Google's Edge caching via headers.

Here's an example of how to setup Edge caching in Express with TypeScript

routes/index.ts:

import * as express from 'express';

const MAX_AGE = 3600; // 1 hr

function addCache(request: express.Request, response: express.Response, next: express.NextFunction) {
  response.header('Cache-Control', `public, max-age=${MAX_AGE}`);
  response.header('Pragma', 'Public');
  next();
}
Splaktar commented 7 years ago

After #107 gets merged to remove the SEO prerendering that was being put in Redis, I think that we can do this.

Splaktar commented 7 years ago

107 has been merged. This work should be able to be started.