Issues and Concepts in Caching
1. The Caching Model
In simplest form, the job of a cache – any cache - is to move data closer to the user. ‘Closeness’ in this case is temporal, rather than physical; it is a measure of time, not of distance. Caches seek to reduce the amount of time that elapses been a request and a response.
Caches are everywhere. Your computer has a memory cache. Your browser has a data cache. Your ATM has a cash cache. The list is endless; caches are a common feature of modern society. Warp Solutions has simply applied the caching model to the complex latency problems that are inherent in modern networking technologies.
2. How Caching Works
Here’s how it works. When configured as a reverse proxy, Warp technology ‘watches’ data traffic flowing to and from the web server, and takes action on the basis of what it sees. If it sees a request that it hasn’t seen before, it passes that request on to the web server, which fulfills the request in the usual fashion. As the request is fulfilled, Warp’s caching engine makes a copy of the data served by the web server and stores it locally.
The next time an identical request is seen, the cache intercepts the request and fulfills the response directly from the data in the cache, without needing to consult the web server, and the response time to the requesting user is cut dramatically. The first user to request the data, then, sees no improvement, but every subsequent user benefits from much faster response times. The more persistent the data, the greater the benefit. The greater the number of users, the greater the benefit.
Caching of this type is exceptionally elegant because it is heuristic – that is, the caching engine learns what to cache, and when, from its own operation. It is thus a precise reflection of the environment that it serves, and is therefore extremely efficient.
3. Warp’s Data Persistence Engine
This all happens in real time, and is completely invisible both to the requesting user and the web server. The trick is in knowing when to ask the web server for new data. If the request is new, there is no difficulty – the request is passed through as described above. But – and it’s a big ‘but’ – if the request is for data that has already been cached, the cache must decide if the cached copy of the data is still identical to the data housed in the web server before intercepting the request. This is critical – one does not want to serve inaccurate data (to a stock broker who’s just requested the stock price of, say, Warp Solutions, Inc. prior to executing a trade for 100,000 shares). It’s bad form.
Warp solves this problem with the Data Persistence Engine. The Data Persistence Engine is a sophisticated, parameterized series of algorithms that assess the accuracy of in-cache data, and inform the cache if a data “refresh” is necessary. Data that needs refreshing is simply retrieved again from the web server and stored locally, replacing the previous copy. Warp’s Data Persistence Engine is easily the most powerful, sophisticated, and flexible technology of it’s kind, and is the most salient reason why Warp Solutions leads the industry in caching technology.
4. Static and Dynamic Content
All data has a life span; the length of this span is referred to as the persistenceof the data. By convention, more persistent data is referred to as staticcontent; less persistent data is called dynamiccontent. In the real world, however, data persistence exists on a continuum, and ‘static’ or ‘dynamic’ designations are more or less arbitrary. Data that is extremely static (the text of a book, for example) might be called inert, and extremely dynamic data (the price of pork bellies in a futures market) might be called volatile.
The data persistence continuum, then, is more complex than a simple binary choice between ‘static’ and ‘dynamic.’ For the purposes of caching, however, these designations turn out to have some practical utility. Static content is data that does not, in general, change with each successive display of a web page. Dynamic content does. That’s a distinction that an information technology professional can work with.
The beauty of Warp Solutions technology is that it doesn’t really matter – both static and dynamic content can be cached. In fact, virtually any kind of data can be cached, regardless of its persistence. The choice, then, is no longer whether it is possible to cache dynamic or highly volatile data, but whether it makes practical sense to do so.
5. Persistence, Popularity, and Population
Highly persistent data is a good candidate for caching, because the likelihood of the need for a refresh, and therefore the efficiency of the cache, is low. Highly volatile data is a poor candidate for the same reasons. Why, then, would an organization want to cache dynamic data? The answer is that persistence is not the only factor to consider. Another factor is popularity. Popularity is a measure of the likelihood that data will be requested, and it is influenced by several factors.
First let’s consider data popularity from the point of view of the audience. From this point of view, one important factor is the locationor visibility of the data. Data on the home page of a web site, for example, is more likely to be requested than data on a page four levels deep. The front page of a newspaper is read more frequently than page 27. The data on your computer screen is more popular than your prized first pressing of the Beatle’s White album (at least in this context). Location is clearly important, which means that an organization can directly influence the popularity of data, and therefore, it’s suitability for caching by simply changing its location.
Data also has inherentpopularity with respect to its audience; the 5 vowels are more popular than the 21 consonants, for example, because they each occur more frequently in English words than any consonant does. Humans tend to prefer symmetry over asymmetry. Structure is preferable to chaos. Nobody likes lawyers. Inherent popularity is more difficult for an organization to influence; efforts to do so are normally grouped under the rubric of ‘Sales and Marketing.’
Now let’s consider popularity from the point of view of the data itself. This is a much more pedestrian viewpoint; popularity is simply a measure of volume – the frequency with which the data is requested. And request volume is most heavily influenced by the size of the client population.
Consider: highly popular data within a small population will be requested frequently. Moderately popular data within an average-sized population will also be requested frequently. Even data that is comparatively unpopular within a huge population will be requested frequently. Organizations that serve a large audience, therefore, are likely to benefit from caching even ‘unpopular’ data, because the size of the population offsets the unpopularity of the data itself.
Clearly, then, in assessing the value of caching technology, an organization must consider notions of persistence, popularity, and population as applied to their web application infrastructure. Data exhibiting strength in any one of these areas must be considered as a good candidate for caching; strength in more than one area makes the decision obvious.
It is interesting to note that, when considered in a larger business context, these same characteristics – persistence, popularity, and population – can be used to influence and measure the overall success and fiscal trajectory of the business itself. In other words, the more successful your business is, the more likely it will benefit from caching technology. For medium and large-sized businesses, caching is rapidly becoming an absolute necessity for an efficient, cost-effective web application infrastructure.
6. Deciding What to Cache
Warp Solutions technology is inherently reactive; it decides what to cache, in part, based upon what it sees as it functions. The process is automatic. Such reactivity is necessary, certainly, but it is not sufficient. Organizations must also be able to direct the operation of the cache proactively.
Proactive caching decisions can be made either implicitly or explicitly. Implicit caching decisions are indirect. That is, they do not involve specific instructions to the cache, but rather involve attempts to modify the three ‘Ps’ above, in order to increase the likelihood that the data will be requested. Moving a press release that’s just been written to the home page of your web site is an implicit caching decision. Exchanging a native URL text string with a large, prominent, clickable image is an implicit caching decision.
Explicit caching decisions, by contrast, are made deterministically – that is, they involve specific instructions to the cache itself about what to cache, and when. (Cache this image now, even if it hasn’t been requested, but don’t cache this stock price, even if it is.) Warp Solutions technology provides unparalleled flexibility in determining what to cache, and when, and organizations can mix and match both explicit and implicit methods in order to achieve optimum caching efficiency as they see fit.
This sounds more complex than it actually is. The fact is that an organization – any organization – can quickly improve the responsiveness, capacity, and reliability of their web application infrastructure by simply installing the technology. No code changes of any kind are necessary. Beyond that, optimizing the caching environment can be as detailed or simple as is mandated by the individual business environment.
7. Partial Page Caching
The electronic nature of hypertext publishing invites rapid changes in content that reflect a rapidly changing world. Today’s web features the widespread use of database-based publishing techniques which facilitate the use of highly dynamic or volatile content, as well as the individual personalizationof pages for each user that accesses them.
This last category – personalization – is an excellent example of data that does not play well with caching technology. It is highly volatile, low in statistical popularity, and has a user population of 1 -- not a great pedigree for caching. Yet, modern web sites increasingly feature some degree of personalization for most of their content, suggesting that these pages are off limits as viable candidates for caching. The answer is simple – don’t cache the whole page. Cache only those impersonalized components of the page that warrant caching, and allow the remainder pass through to the web server.
It’s an elegant solution to a challenging problem that may be easy to articulate, but is much more difficult to implement technically. It’s another example of the technical prowess that sets Warp Solutions apart. We’ve done more, simply, than figure out how to do it – we’ve implemented partial page caching in a way that minimizes the impact to your code base and your infrastructure.