What Facebook’s New Study Reveals About Web Cache Effectiveness in 2024
Facebook’s web team revisited Yahoo’s 2007 cache research, measuring how often PC and mobile browsers serve resources from cache today, discovering that roughly 45% of requests still miss the cache and that cache lifetimes are short, prompting new optimization recommendations.
Translator's Preface
Eight years ago Yahoo conducted a detailed study of web caching. With the rapid evolution of the Internet, Facebook's web team has now collected and analyzed fresh data on cache behavior for both desktop and mobile resources.
Main Text
Page load speed is crucial for every website, yet caching—allowing browsers to reuse previously downloaded resources—is often overlooked despite its significant impact on performance.
Re-Research
Inspired by Yahoo’s methodology, Facebook created a PHP endpoint that serves an image while logging each request in a database. The image’s HTTP headers control browser and proxy caching. The following diagram shows the original header configuration:
Due to known bugs in IE7 and IE8, the two header attributes were replaced as shown below:
When a browser requests the image, two scenarios occur:
If the image has never been loaded, the server returns a 200 Success response with the image data, and the browser caches the Last-Modified and ETag values.
If the image was previously loaded, the browser sends If-None-Match or If-Modified-Since headers; the server can respond with 304 Not Modified, avoiding retransmission of the image data.
The image was embedded in Facebook’s search bar so that each page load would trigger the caching test.
Research Results
After several weeks of data collection, analysis of the most recent seven days showed that 25.5% of requests still resulted in an empty cache. Breaking the data down, 24.8% of desktop requests and 26.9% of mobile requests were uncached.
Further segmentation of desktop browsers revealed higher cache rates for Chrome and Opera. Firefox data was excluded because versions ≤31 showed an 80% cache rate, while newer versions conflicted with our measurement method.
Mobile data showed cache rates ranging from 68% to 84%, with variations likely due to lower‑end devices.
The proportion of empty‑cache users for mobile versus desktop is illustrated below:
Overall, 44.6% of users had an empty cache, closely matching Yahoo’s 2007 findings.
Further
Given Facebook’s rapid release cycle (two versions per day), we investigated optimal cache lifetimes by measuring the time between the first successful request and the first 304 response. The resulting chart shows the distribution of cache acquisition times.
The horizontal axis represents hours; the vertical lines P50 and P75 indicate the time by which 50% and 75% of requests have cached resources. For mobile users, 50% of requests are cached after roughly 12 hours.
Practical Application
Our findings align with the 2007 study: when excluding newer Firefox versions, the maximum cache hit rate reaches 84.1%, surpassing the earlier 80% peak. However, cache lifetimes remain short—about 47 hours after a new version release, only 42% of requests are cached.
The growth of web page sizes (from ~168 KB in 2007 to >1 MB today) stresses browser caches, making efficient caching more critical than ever.
Best practices include using external CSS/JS, setting Cache‑Control and ETag headers, compressing assets, employing versioned URLs, and separating frequently updated resources. These recommendations benefit large‑scale sites like Facebook as well as smaller websites.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
