Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Taming content delivery at scale

Taming content delivery at scale

Nowadays web platforms are composed of multiple parts - large applications are surrounded by countless of smaller services and tiny serverless functions. If you’ve ever started a transition from a monolith to more distributed model you know that’s very rarely a big bang. It’s a long process that takes time. You take one feature, extract it to a module and define a clear API, so it can be incorporated easily into a bigger picture that you’re building.

Eventually you end up with a complex distributed platform that has to be managed somehow. Deployments, traffic routing, security, reliability - you have to consider all of those aspects in your implementation plan.

At the same time you have to keep in mind that even the most sophisticated platform doesn’t provide any value by itself if it doesn’t meet expectations of your end users.

During this talk I’d like to present how Cognifide manages platforms composed of many applications, route traffic between smaller components and delivers content to users spread all over the world via Content Delivery Network (CDN).

Jakub Wądołowski

September 26, 2019
Tweet

More Decks by Jakub Wądołowski

Other Decks in Technology

Transcript

  1. The generic story https://flic.kr/p/ithHFu • Banking / insurance / automotive

    / retail industry • 100% offline business since the very beginning • Online presence followed by multi-market expansion
  2. Err… now what? • Will my application handle increased load?

    • Should I replicate my stack N times? • What about end user performance? https://flic.kr/p/7F4bHa
  3. CDN features https://flic.kr/p/qKCXMK • reverse caching proxy • HTTP routing

    • request/response flow control (VCL) • content assembly (ESI - Edge Side Includes) • web application firewall (WAF) • image optimizer • various L4/L7 optimizations (Brotli, HTTP/2, TLS, BBR, etc) • edge computing
  4. Things go south sometimes… https://flic.kr/p/7rstvj • My content is dynamic!

    • I use personalisation! • I need to authenticate to see anything! • A/B tests! • …
  5. There’s no such things as dynamic content. Everything is static

    until it changes. Tyler McMullen, CTO at Fastly
  6. HTTP/1.1 302 Found Date: Fri, 09 Aug 2019 09:56:18 GMT

    Content-Type: text/html; charset=utf-8 Content-Length: 36538 Connection: keep-alive Cache-Control: no-cache, no-store, must-revalidate Location: https://example.com/secure Server: nginx Caching mistake #1
  7. HTTP/1.1 302 Found Date: Fri, 09 Aug 2019 09:56:18 GMT

    Content-Type: text/html; charset=utf-8 Content-Length: 36538 Connection: keep-alive Cache-Control: no-cache, no-store, must-revalidate Location: https://example.com/secure Server: nginx Caching mistake #1
  8. HTTP/1.1 302 Found Date: Fri, 09 Aug 2019 09:56:18 GMT

    Content-Type: text/html; charset=utf-8 Content-Length: 36538 Connection: keep-alive Cache-Control: no-cache, no-store, must-revalidate Location: https://example.com/secure Server: nginx Caching mistake #1
  9. HTTP/1.1 302 Found Date: Fri, 09 Aug 2019 09:56:18 GMT

    Content-Type: text/html; charset=utf-8 Content-Length: 36538 Connection: keep-alive Cache-Control: no-cache, no-store, must-revalidate Location: https://example.com/secure Server: nginx Caching mistake #1
  10. HTTP/1.1 200 OK Date: Fri, 09 Aug 2019 09:14:38 GMT

    Content-Type: text/html; charset=utf-8 Content-Length: 87112 Connection: keep-alive Cache-Control: public, no-cache="Set-Cookie", max-age=180 Expires: Fri, 09 Aug 2019 09:17:22 GMT Last-Modified: Fri, 09 Aug 2019 09:14:22 GMT Vary: Accept-Encoding Server: nginx Caching mistake #2
  11. HTTP/1.1 200 OK Date: Fri, 09 Aug 2019 09:14:38 GMT

    Content-Type: text/html; charset=utf-8 Content-Length: 87112 Connection: keep-alive Cache-Control: public, no-cache="Set-Cookie", max-age=180 Expires: Fri, 09 Aug 2019 09:17:22 GMT Last-Modified: Fri, 09 Aug 2019 09:14:22 GMT Vary: Accept-Encoding Server: nginx Caching mistake #2
  12. In http 1.1, Roy has proposed some features for the

    new cache-control directive that allow servers to selectively disable caching on specific headers. This would be, for example: cache-control: no-cache="set-cookie" Caching mistake #2