Better Mobile Performance with the HTTP Vary Header
By Hayes Kim, Product Management
When you sign up with a content delivery network (CDN), chances are you’re looking for better performance. Speed is one of the most common reasons companies use CDNs. But a recent article at Search Engine Watch, “How Google’s Mobile Best Practices Can Slow Your Site Down,” suggests that CDNs don’t vary their caching to maximize performance. In particular, it’s hard on Google, which is ultimately most concerned with delivering an appropriate end-user experience on many different platforms.
CDNs, in general, sometimes get a bad rap because we have to work with legacy systems and technologies. In the past, CDNs did indeed have problems handling varying content caching (due to I/O limitations on disk and configuration inflexibility), but those days are over now. Today, CDNs can effectively leverage SSDs — as we long have — to open up the world of I/O-intensive operations such as caching based on user-agent, accept-language, or whatever else customers need. CDNs that want to move into mobile without sacrificing performance (or SEO) must execute a strategy to allow extremely flexible “cache-key” generation functionality.
As with any flexible solution, making good decisions around how to wield that functionality will ultimately lead to greater performance for your end users, both on mobile devices and desktops. The fundamental consideration is whether the CDN can appropriately identify which attributes are legitimate to vary on, and if it can perform the appropriate internal manipulations to retrieve, generate, and store multiple instances of resource referenced with a single file name. These varying techniques can rely on a combination of information embedded in the URL (query string, file path/name), HTTP headers (typically user-agent or cookie parameters), or metadata derived from the client IP (network or geographic location).
One thing the Search Engine Watch article does get right is that, with so many user-agents out in the wild, varying on user-agent does lead to downstream complications that hurt performance. This will ultimately lead to a low cache-to-hit ratio and a lot more stress on your origin server. This turns the CDN into a reverse proxy, which will slow things down.
How to beat this? By intelligently selecting components of the user-agent that are important and eliminating those that aren’t. At Verizon Digital Media Services, we’re looking at every aspect of mobile performance; we’re searching for ways to optimize connections, identifying and reporting on mobile traffic, providing better turn key tools and configurations, and delivering a holistic approach to mobile performance. We believe the best CDNs are becoming more than just CDNs; they’re becoming web performance organizations.