Making AWS News stupid fast with smart caching
lucvandonkersgoed.com
lucvandonkersgoed.com
These days you never know, just plop down any word after AWS and you’re likely to win AWS bingo.
> The logo has a clear "unofficial" tag and the information is a stream of press releases. I don't see why anyone would care about it.
To see that you have to actually visit and pay attention. By name only, "AWS News" looks like an official Amazon/AWF too. The potential for confusion is real (any actual impact on the company, less so.)
As such I think it's a well written clear example. But you always need to bear in mind that a toy problem simple enough to demo a technique clearly, is seldom complex enough to need the technique.
Stale-while-revalidate: see https://web.dev/articles/stale-while-revalidate & https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...
Immutable: https://datatracker.ietf.org/doc/html/rfc8246 & https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...
And if, like in the article, you’re using a CDN, `s-maxage` (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...) is quite useful. Set it to a long time, and purge the CDN cache on deploy.
I'm also wondering how to deal with scenario where we introduce sorting by popularity. With the current design, User might see articles swap places after the first render.
I agree with the scalability benefits, but not sure about maintainability. In fact introducing additional complexity usually leads to higher maintenance costs.
This is the key insight. But I would phrase it more as "segregate data by mutability" as it's about more than caching. More than once I've seen pain caused by a design that failed to do this.