TL;DR - Scalable DNS, TLS termination, app firewall, caching, and CDN
Also check out fastly which was/is Varnish-based and built by ex Wikia peeps.
If you have enough budget, engineering talent, or customers & ARPU, you can build your own AnyCast CDN, DDoS defenses, app caching, and app firewall. Until you have very high bills with SaaS third-party vendors, that's the time to think about migrating to DIY, but otherwise stick with division of labor and specialization of trade for things that aren't your core business.