4 ms·
I don't get why not. How do you think this was achieved before lambda? Or even before aws? It is a news site not Facebook. The feed would only ever be a subset
by recuter 5y ago
I don't get why not. How do you think this was achieved before lambda? Or even before aws?
It is a news site not Facebook. The feed would only ever be a subset of all the articles in cache. It can itself be cached, there are only so many permutations. Different people will have different feeds, but there will be people with the exact same feed as you.
Crunch those recommendations however you want wherever you want and spew them unto S3 at your leisure. Have your varnish cache sit on top of that. Set your personalized subscriptions via a cookie. Varnish on each request will decide which one out of n (probably n<10000) feeds to include in your html response, in under 2ms.
This is all stateless. Have two servers in two regions. Done.
Maybe you'll reboot them every couple of years.
- notyourday 5y agoBeen there, done that. Can confirm it works swimmingly. It is much more fun though: don't be clever. Just cache-bust on change.