> ## Documentation Index
> Fetch the complete documentation index at: https://context7.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Keeping Libraries Fresh

> How Context7 ensures library documentation stays fresh

Context7 automatically refreshes library documentation so that developers always receive accurate, up-to-date context in their coding environment. Here's how it works.

## Automatic Refresh

Every time a library is requested through Context7 — whether via the MCP server or the REST API — the system checks when the documentation was last updated. If it's older than a threshold based on the library's popularity, a background refresh is triggered automatically.

### Refresh Thresholds

The staleness threshold is based on each library's popularity rank in Context7:

| Popularity Rank | Refresh Threshold |
| - | - |
| Top 100 | 1 day |
| Top 1,000 | 15 days |
| Top 5,000 | 30 days |
| All others | 45 days |

Popular libraries are refreshed more frequently because developers rely on them more heavily and they tend to get updated faster. Website libraries use a slightly higher threshold than the values above.

> [!NOTE]
>
> The refresh is triggered in the background and does not affect the response time of your current request. You will receive the existing documentation immediately while the update runs asynchronously.

## Manual Refresh

Logged-in users can manually trigger a refresh for any library directly from the library page on Context7 or via the [refresh API endpoint](https://context7.com/docs/api-reference/refresh/refresh-a-library.md). This is useful when you know a library has just released a new version and want the updated documentation immediately, without waiting for the automatic cycle to complete.

Library owners who have [claimed their library](https://context7.com/docs/howto/claiming-libraries.md) receive higher refresh rate limits, giving them more control over how frequently their documentation can be updated.

## What Triggers an Automated Refresh

A refresh is triggered when all of the following conditions are met:

* The library has been requested recently
* The documentation is older than the threshold for that library's popularity rank

If a library hasn't been requested recently, it won't be refreshed — keeping the system efficient and focused on actively used documentation.

> [!NOTE]
>
> Private libraries are not refreshed automatically. To update a private library's documentation, trigger a manual refresh from the library page.

## Supported Library Types

Automatic and manual refreshes work across all supported source types:

* **Git repositories** — re-parsed from the configured branch
* **Websites** — re-crawled from the base URL
* **OpenAPI specs** — re-fetched and re-indexed from the spec source

### When a Website Refresh Fails

A website refresh replaces the current version only when the crawl succeeds. If the crawl reads fewer than 10% of the pages in the last version, for example because the site now blocks the crawler, the last version stays in place. The reason appears in the library logs, and the refresh is tried again later. If the site really became smaller, change its crawl settings: the first refresh after a settings change skips this check.

### When a Repository Refresh Finds a New Major Release

A repository refresh replaces the library's main version, so the previous major's documentation would otherwise disappear the day the next major ships. When a refresh finds a new major based on the repository's version tags, Context7 keeps the newest release of the previous major as an additional version and parses it. For example, when a library moves from `v16.2.0` to `v17.0.0`, the last `v16` release is kept and becomes available as a version. On `0.x` versions the minor counts as the major, so a move from `0.15.x` to `0.16.0` keeps the last `0.15` release.

A kept version is not removed by [`previousVersions`](https://context7.com/docs/library-owners) reconciliation, so it stays even when the config does not list it.

No version is kept for a patch or minor release, for a move back or to a different tag family, for calendar, date, or dotless versions, or for a library with a custom branch. Private repositories, injection-flagged libraries, and sources other than Git repositories are left out.

### When a Source Repository Is Gone

If a library's Git repository is deleted or no longer accessible, the last indexed version keeps being served. Once a refresh at least a day later confirms the repository is still unreachable, the library page and its admin page show a notice that the source repository could not be reached since the date it was first found gone. A successful refresh clears the notice. To clear it, make the repository reachable again, or [redirect the library](https://context7.com/docs/howto/claiming-libraries.md) to the library that replaces it.

## Related

* [Adding Libraries](https://context7.com/docs/adding-libraries.md)
* [Claim Your Library](https://context7.com/docs/howto/claiming-libraries.md)
* [Managing Versions](https://context7.com/docs/howto/claiming-libraries.md#managing-versions)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.