Also available is the ‘memory cache’, which is located in the system’s volatile main memory (RAM) and merely used to improve the surfing experience. Pages that appear in the browser history are then stored in the cache in a volatile manner (power off means loss of data). The same applies to assets from SSL connections which are not stored in the disk cache as they may pose a security risk. With Mozilla browsers the disk cache takes up 50MB by default, whereas Microsoft browsers are non-transparent in this regard, and, as expected, leave it up to the operating system to handle the memory cache.
In terms of caching, XING focuses on optimizing ‘disk cache’ utilization as the ‘memory cache’ cannot be used in a targeted manner and does not represent a sound method for cache optimizing in the long term. We therefore do not consider the specific use of offline disk caching to be effective due to a lack of general support.
The ideal client caching state can be seen in the following figure:
Ideal state of a page request
As all assets are already cached by the client, no requests are sent to the server with only HTML content and tracking pixels being reloaded. At most, individual assets should be checked to ensure they are up to date by means of a 304 (not modified) request. This in turn equates to the minimum possible number of page views, i.e. minimal traffic, only the bare minimum of requests, and minimal processing time in terms of downloading time.
But can this state actually be achieved in a real-life scenario?
Currently, at least 50% of our PCs run Internet Explorer 8, Opera and FF2/3.x browsers, and this number is expected to rise (see following figure).
Percentage distribution of the top 5 browsers in use at XING
In their standard delivered state, these browsers have a disk cache of 50MB (Opera 20MB). At first glance this seems to be enough as an entire page request hardly ever exceeds 500KB.
However, a number of key aspects need to be taken into consideration:
- Most users never clear their cache.
- A rising number of (2.0) websites are constantly increasing in size coupled with well-documented instructions availabe for everyone in the web (e.g. Steve Souders) mean that operators are constantly having to work on squeezing as much efficiency out of user caches as possible.
- Youtube, last.fm and other streaming stations are blowing up the cache with sometimes just one video/stream.
- When looked at simplistically, the cache is a kind of “least recently used” (LRU) list, i.e. the files that come in and are not used for week may be dropped out, if meanwhile other files come in.
- With some browsers, only the newer versions cache SSL content like that of xing.com (Firefox version 3.0 and above), and only if the cache header is ‘public’.
The continual development of the web means that the ratio of kilobytes to page view is likely to rise, as confirmed by our in-house statistics based on the xing.com website.
A combination of the ‘total time of the file in the cache’ and ‘last use’ then determines which files are deleted first.
So what is the upshot of this? Most users don’t have the pleasure of fully retrieving assets from the browser cache. Instead, the assets have to be requested again from the server, which increases loading time by at least 40%. When measured precisely, the number of visitors to the site with an empty or partially empty cache is surprisingly high.
See the green line in following figure for more information.
Image caching rate at xing.com
Our measurements correlate with those of a study conducted by Yahoo which used a backend-based method and returned an ‘empty cache experience’ of around 40% to 60%.
Conclusion: Well-designed caching has been proven to have a positive effect on user experience and is a genuine must both now and in the future. However, this isn’t the only area we need to focus on as there are too many other factors out of our control which may rapidly lead to the entire client caching being cleared out so that the user has to download all of the assets again. To this end, strategies such as minimizing the code and modularization need to be implemented together with lazy loading. Efficient caching and minimal requests are the only combination that can guarantee positive user experience in the long term.