NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Topical Result Caching in Web Search Engines

Ida Mele, Nicola Tonellotto, Ophir Frieder, Raffaele PeregoarXiv 2020

TL;DR

Traditional web search caches struggle to retain moderately popular queries that fluctuate based on time or context. This paper introduces the Static-Topic-Dynamic (STD) cache, which adds a topic-aware layer to partition cache space according to topic popularity. By capturing topic-specific temporal patterns, STD boosts cache hit rates by up to 3.6% and closes the gap to the theoretical optimal caching strategy by over 35%.

What Problem Does This Paper Address?

Web search engines process millions of queries a second. To minimize latency, backend server workloads, and electricity costs, they rely heavily on result caching. The standard industry approach is the Static-Dynamic Cache (SDC). SDC splits cache space into two:

  1. A static portion populated offline with globally popular, evergreen queries (e.g., "facebook", "google").
  2. A dynamic portion that uses a Least Recently Used (LRU) eviction policy to catch sudden, short-term bursts of traffic.

However, SDC fails to capture a massive middle ground: moderately popular queries with periodic, topic-specific temporal locality. For example, queries about "weather forecast" spike in the morning, while "football scores" spike on weekends. These queries aren't globally popular enough to sit in the static cache permanently, and they aren't searched frequently enough within a tiny time window to survive the rapid turnover of a general dynamic LRU cache. They fall through the cracks, causing avoidable cache misses.

Methods

The authors propose the Static-Topic-Dynamic (STD) cache architecture, which introduces a third layer specifically for topic-based caching.

Figure 1: Example of STD cache.

1. Three-Layer Architecture

The cache space is divided into three distinct components:

  • Static Cache ($S$): Stores the absolute most frequent queries overall.
  • Topic Cache ($T$): Subdivided into $k$ independent sections, one for each topic (e.g., banking, education, health). Space can be allocated equally or proportionally to the topic's historical popularity.
  • Dynamic Cache ($D$): A standard LRU cache that handles queries with no clear topic or highly transient bursts.

2. Query Topic Distillation via LDA

Because search queries are notoriously short and ambiguous (e.g., "apple"), the authors train a Latent Dirichlet Allocation (LDA) topic model on query-document pairs. They enrich the raw query terms with the full text of the web pages users actually clicked on in the logs. A voting scheme then assigns a single dominant topic to each query based on historical click volume.

3. Cache Management Workflow

When a query arrives, the system checks the static cache first. If it misses, it identifies the query's topic and checks that specific topic's sub-cache. If it misses again (or has no topic), it falls back to the general dynamic cache.

Figure 2: Example of a search engine using the STD cache. The question mark represents the user query. In case of a hit in the cache, the results are returned to the user immediately (green arrow). Otherwise, a cache miss is encountered and the request is sent to the back-end server (red arrows).

The authors experimented with multiple configurations, finding that managing each topic's sub-cache using its own mini-SDC strategy ($STD^v_{SDC}$) yielded the highest hit rates.

Datasets

The approach was evaluated using two massive, real-world query logs:

  • AOL Query Log: ~36M records from 2006, filtered down to a stream of 20M unique query-click events.
  • MSN Query Log: ~14.9M records, yielding 8.8M records with clicked URLs.
  • Enriched Document Collection: 1M web pages for AOL and 2.1M for MSN were crawled from the clicked URLs to provide the rich textual context needed to train the LDA model (configured to discover $k=500$ topics).

Key Insights and Ideas

  • Topics Have "Longer Memories" Than Queries: The core "aha moment" is that while individual queries might seem sporadic, grouping them by topic reveals stable, predictable temporal rhythms. The average distance between misses in topic caches is much larger than in a standard LRU cache, meaning topic-based caching successfully retains items over longer, stretched-out intervals.
  • Proportional Sizing Prevents Starvation: Allocating cache space dynamically based on topic popularity ($STD^v$) significantly outperforms fixed sizing ($STD^f$). It ensures dominant topics get the retention power they need without letting niche topics waste precious cache slots.
  • Hybridizing the Topic Layer Wins: Treating each topic slot as a mini-SDC (Static-Dynamic Cache) rather than a pure LRU cache performs best. It allows the system to capture both the "evergreen" queries within a specific topic and sudden topical bursts simultaneously.

Key Results

  • Hit Rate Boost: Across various cache sizes (64K to 1024K entries), the STD model consistently outperformed the SDC baseline. It achieved absolute hit rate increases of up to 3.6% on the AOL dataset and 2.0% on the MSN dataset.
  • Closing the Gap to Perfection: Compared to Bélády’s theoretical optimal (clairvoyant) caching algorithm—which requires knowing the future—STD reduced SDC's performance gap by up to 36.51% for AOL and 31.04% for MSN.
  • Synergy with Admission Policies: When paired with query admission policies (which filter out "polluting" or one-hit-wonder queries), STD maintained its edge, pushing hit rates even closer to the theoretical upper bound.

Limitations and Future Work

  • Cold Start / Unclassified Queries: The system cannot assign a topic to entirely new queries or queries without historical click data. These default to the general dynamic cache, meaning the system's performance is bound by its topic classification coverage (which was 65% for AOL and 58% for MSN in testing).
  • Future Directions: The authors suggest exploring short-text topic modeling techniques that don't rely as heavily on crawling clicked page content. They also plan to investigate how to integrate STD with lower-level backend caches, such as those storing inverted index posting lists.

Summary updated

Abstract

Caching search results is employed in information retrieval systems to expedite query processing and reduce back-end server workload. Motivated by the observation that queries belonging to different topics have different temporal-locality patterns, we investigate a novel caching model called STD (Static-Topic-Dynamic cache). It improves traditional SDC (Static-Dynamic Cache) that stores in a static cache the results of popular queries and manages the dynamic cache with a replacement policy for intercepting the temporal variations in the query stream. Our proposed caching scheme includes another layer for topic-based caching, where the entries are allocated to different topics (e.g., weather, education). The results of queries characterized by a topic are kept in the fraction of the cache dedicated to it. This permits to adapt the cache-space utilization to the temporal locality of the various topics and reduces cache misses due to those queries that are neither sufficiently popular to be in the static portion nor requested within short-time intervals to be in the dynamic portion. We simulate different configurations for STD using two real-world query streams. Experiments demonstrate that our approach outperforms SDC with an increase up to 3% in terms of hit rates, and up to 36% of gap reduction w.r.t. SDC from the theoretical optimal caching algorithm.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
AOL query logSTD-SDC^v (C2), best STD configurationhit rate37.34%Web Search Result Caching · split: test · cache-size=64K entries · configuration=best STD
Source quote
L349: 64K │ 43.67% │ 33.70% │ 37.34% │ 9.97% │ 6.33% │ 3.64% │ 36.51%
MSN query logSTD-SDC^v (C2), best STD configurationhit rate47.15%Web Search Result Caching · split: test · cache-size=64K entries · configuration=best STD
Source quote
L355: 64K │ 51.54% │ 45.23% │ 47.15% │ 6.31% │ 4.39% │ 1.92% │ 30.42%
Reported baseline / comparator measurements (4)
BenchmarkMethodMetricScoreProtocol / Evidence
AOL query logSDC baselinehit rate33.70%Web Search Result Caching · split: test · cache-size=64K entries
Source quote
L349: 64K │ 43.67% │ 33.70% │ 37.34% │ 9.97% │ 6.33% │ 3.64% │ 36.51%
AOL query logBelady's optimal caching algorithm baselinehit rate43.67%Web Search Result Caching · policy=clairvoyant optimal · cache-size=64K entries
Source quote
L349: 64K │ 43.67% │ 33.70% │ 37.34% │ 9.97% │ 6.33% │ 3.64% │ 36.51%
MSN query logSDC baselinehit rate45.23%Web Search Result Caching · split: test · cache-size=64K entries
Source quote
L355: 64K │ 51.54% │ 45.23% │ 47.15% │ 6.31% │ 4.39% │ 1.92% │ 30.42%
MSN query logBelady's optimal caching algorithm baselinehit rate51.54%Web Search Result Caching · policy=clairvoyant optimal · cache-size=64K entries
Source quote
L355: 64K │ 51.54% │ 45.23% │ 47.15% │ 6.31% │ 4.39% │ 1.92% │ 30.42%
BibTeX
@misc{mele2020topical,
  author = {Ida Mele and Nicola Tonellotto and Ophir Frieder and Raffaele Perego},
  title = {{Topical Result Caching in Web Search Engines}},
  year = {2020},
  eprint = {2001.03010},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2001.03010},
}

Loading related content...

Figure