Cache Improvements
Last week, we migrated our application cache layer under Cloudflare's proxy umbrella! We already take advantage of their certificate management solution, so the next logical step was to move other pieces of our infrastructure into the same place.
TLDR
Our cache now serves more content and from a wider variety of edge locations! Across the board, all unauthenticated web traffic should see performance increases.
From Homegrown to Managed
Prior to migrating this cache layer, we owned a self-managed implementation consisting of a set of Nginx caches sitting behind a classic load balancer in AWS. All of the traffic going to our hubs (via standard ReadMe domain, or custom DNS), routed through this layer before settling at our origin servers.
Ultimately, there were a few drawbacks:
- Request Protection: We built this a few years ago, so our implementation did not take advantage of some of the Web Application Firewall features AWS has introduced since. As a result, this layer did not have modern content firewall or DDOS protections.
- Scaling: This layer, although programmatically scaled behind our load balancer, was a bottle neck. We could only scale it in and out so much.
- Access Control: We were not able to dial in access control to the level we desired.
Thankfully, moving to a managed solution alleviated all of these issues! We now have extensive firewall and DDOS protections, that are seamlessly scaled and customizable.
Performance Improvements
From a functional perspective, caches store data in-memory. This allows for a metadata to dictate whether desired information is pulled from a very easily accessible source, or be fetched from the origin (which can take longer). Of course, our previous implementation did this, in part. But, it did it from a set of locations that were not optimized for where the web traffic came from.
We are now caching more, and doing so at edge locations near you. That means that any cached pages that are accessed are closer to you, and to your customers. Because distance travelled is reduced, latency is drastically reduced, and content is served faster!