With Exa, we can already search the web using LLMs. By default, we serve cached content to bias for the fastest response possible. If you need fresher content, use the
maxAgeHours parameter to control how old cached content can be before we fetch a live version.
maxAgeHours
maxAgeHours sets the maximum acceptable age (in hours) for cached content. If the cached version is older than this threshold, Exa will livecrawl the page to get fresh content.
| Value | Behavior | Best For |
|---|---|---|
24 | Use cache if less than 24 hours old, otherwise livecrawl | Daily-fresh content |
1 | Use cache if less than 1 hour old, otherwise livecrawl | Near real-time data |
0 | Always livecrawl (ignore cache entirely) | Real-time data where cached content is unusable |
-1 | Never livecrawl (cache only) | Maximum speed, historical/static content |
| (omit) | Default behavior (livecrawl as fallback if no cache exists) | Recommended — balanced speed and freshness |
When LiveCrawl Isn’t Necessary
Cached data is sufficient for many queries, especially for historical topics like “What were the major causes of World War II?” or educational content such as “How does photosynthesis work?” These subjects rarely change, so reliable cached results can provide accurate information quickly.Examples
Company News
SetmaxAgeHours to a low value to ensure you get fresh content. Pair with livecrawlTimeout to prevent long-running calls from hanging:
Production Applications
For production apps, setmaxAgeHours to match how frequently your target content changes. Pair with livecrawlTimeout for reliability:
Deprecated: livecrawl options
Thelivecrawl string parameter ("always", "preferred", "fallback", "never") is deprecated in favor of maxAgeHours. Existing code using livecrawl will continue to work, but we recommend migrating to maxAgeHours for more precise control over content freshness.
| Old livecrawl value | Equivalent maxAgeHours |
|---|---|
"always" | 0 |
"never" | -1 |
"fallback" | (omit — default) |
"preferred" has no direct equivalent since it always livecrawls regardless of cache age. Use a low maxAgeHours value (e.g. 1) for similar behavior.
