# Recent Searches & Cache

SEO Utils remembers every DataForSEO search you run across Keyword Explorer, Traffic Analytics, Backlink Analytics, Content Gap, and Backlink Gap. You can re-open past searches in one click, see how fresh the data is, and refresh it when you need the latest numbers — all without paying extra API credits for data you've already pulled.

{% hint style="success" %}
Every search is stored locally in your SQLite database, so your history survives app restarts, machine reboots, and navigation away to other tools. No data leaves your machine unless you've also configured [S3 Cache for DataForSEO Data](/guide/data-sharing-with-s3.md).
{% endhint %}

## Recent Searches List

Under every DataForSEO tool's search bar, you'll see a **"Recent searches"** card listing your past searches for that tool.

<figure><img src="/files/dlZ5qgU6MN4IQTgbuWP9" alt="" width="563"><figcaption><p>Recent searches list below the Backlink Analytics search bar</p></figcaption></figure>

Each row shows:

* **Target**: the domain, URL, or keyword you searched
* **Context badges**: for Content Gap and Backlink Gap, the number of competitors; for Keyword Explorer, the search engine (Google or Bing)
* **Last accessed**: when you last opened this search

Click any row to re-open it instantly — no API call is made if the data is still cached.

### Managing History

| Action                              | How to do it                                                 |
| ----------------------------------- | ------------------------------------------------------------ |
| **Open a past search**              | Click the row                                                |
| **Delete one entry**                | Hover over the row and click the X that appears on the right |
| **Clear all entries for this tool** | Click the ⋯ menu in the card header → **Clear all**          |
| **Show more entries**               | Click "Show N more" at the bottom (up to 25 rows)            |

{% hint style="info" %}
Only your **100 most recent searches per tool** are kept. Older entries are automatically pruned. Deleting a history row does **not** delete the underlying cached data — re-typing the same search will still hit the cache.
{% endhint %}

## Freshness Widget

While viewing any DataForSEO result page, a small widget anchors to the bottom-right corner showing when the data was last fetched and a Refresh button.

<figure><img src="/files/TlR25zBKruPChP05OOiP" alt=""><figcaption><p>Freshness widget showing "Data updated 14 hours ago" and a Refresh button</p></figcaption></figure>

### Color Coding

The widget changes color to signal how stale the data is:

| Age         | Color                        | Meaning                              |
| ----------- | ---------------------------- | ------------------------------------ |
| Under 1 day | Green                        | Fresh — recently fetched             |
| 1–14 days   | Default (muted)              | Normal working range                 |
| 14–30 days  | Amber                        | Stale — consider refreshing          |
| 30+ days    | Red (with "Stale · " prefix) | Very stale — data is likely outdated |

### Collapsing the Widget

Click the chevron (›) to collapse the widget into a small clock icon. Click the icon to expand it again. Your preference is remembered across sessions and tools.

<figure><img src="/files/42Dm3G0jKTatctiMlltl" alt="" width="323"><figcaption><p>Collapsed widget shown as a small clock icon in the bottom-right corner</p></figcaption></figure>

## Refresh Button

Clicking **Refresh** forces a fresh fetch from the DataForSEO API, bypassing all caches (local memory, local database, and your S3 shared tier if configured).

### How Refresh Works Across Tabs

Backlink Analytics and Traffic Analytics have multiple tabs for the same target (Overview, Backlinks, Referring Domains, Organic Keywords, etc.). When you click Refresh on any tab:

{% stepper %}
{% step %}
**All tabs' cached data is invalidated**

The cache is wiped for **every tab** of that target — Overview, Backlinks, Referring Domains, Anchor Texts, Competitors, Organic Keywords, etc. If you have the S3 shared cache configured, matching S3 objects are also removed so your teammates see fresh data on their next visit.
{% endstep %}

{% step %}
**Only the current tab re-fetches immediately**

To save API credits, only the tab you're currently viewing actively re-fetches.
{% endstep %}

{% step %}
**Other tabs re-fetch lazily on visit**

When you switch to another tab (e.g., from Overview to Backlinks), that tab will hit the API because its cache is empty. This avoids spending credits on tabs you don't actually open.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
Refreshing a paginated result resets pagination to page 1 and refetches only page 1. Other pages are re-fetched individually when you navigate to them.
{% endhint %}

## Settings

Go to **Settings > Services** and scroll to the **DataForSEO Local Cache** section.

<figure><img src="/files/aRKRhQDgxCM5w5kuKnp9" alt=""><figcaption><p>DataForSEO Local Cache settings card with stats and Clear button</p></figcaption></figure>

The card shows:

* **Cached responses** — how many API responses are stored locally
* **Search history entries** — how many distinct past searches are in your history list
* **Storage used** — approximate disk footprint

### Auto-invalidate Cache After X Days

Set how long cached DataForSEO responses are kept in your local database before they are removed and refetched from the API on the next request. The default is **14 days**.

| Value                                          | Behavior                                                                                                                             |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **Any positive number** (e.g. `7`, `14`, `30`) | Cached responses older than this many days are removed automatically. Cleanup runs hourly while the app is open and once at startup. |
| **`0`**                                        | Auto-cleanup is disabled. Cached responses are kept indefinitely until you click **Clear Cache & History** below.                    |

{% hint style="info" %}
Only the **cached responses** are removed — your "Recent searches" list is preserved. Clicking a history entry whose cache has expired triggers a fresh API request and rebuilds the cache automatically.
{% endhint %}

{% hint style="warning" %}
This setting only affects your **local** database. The shared S3 cache (if configured) is governed by its own 7-day rolling cleanup and is unaffected.
{% endhint %}

### Clear Cache & History

The **Clear Cache & History** button removes every cached response and every search history entry from your local database at once. Use it if you want a completely clean slate — the next time you use any DataForSEO tool, data will be fetched fresh from the API.

{% hint style="danger" %}
This action cannot be undone. Any future searches that would have hit the cache will consume API credits instead.
{% endhint %}

## Relationship with S3 Cache

If you've set up [S3 Cache for DataForSEO Data](/guide/data-sharing-with-s3.md), it works alongside the local cache as a third tier:

| Tier          | Storage                                                | Who sees it                               |
| ------------- | ------------------------------------------------------ | ----------------------------------------- |
| Memory        | RAM (24h)                                              | You only, this session                    |
| Local DB      | Your SQLite file (14-day TTL by default, configurable) | You only, persists across restarts        |
| S3 (optional) | Your configured S3 bucket (7-day TTL)                  | You + teammates with the same credentials |

When a tool needs data, SEO Utils checks the tiers in order and falls through to the DataForSEO API only if all tiers miss.

{% hint style="info" %}
**Clear Cache & History** in this card only affects your **local** tiers. To clear the shared S3 cache, use **Purge Cache** in the S3 Cache Settings card instead.
{% endhint %}

## Tips

* **Let the widget guide your refresh habits.** If it's green, your data is fresh; if it's amber or red, consider refreshing before drawing conclusions.
* **Collapse the widget** if you prefer more screen space — the clock icon still shows the age via tooltip on hover.
* **Use history instead of re-typing** a domain. Clicking a history row reloads instantly and won't burn API credits on cached pages.
* **Tune the auto-invalidate setting** to match how often you need fresh data. Lower it (e.g., 3–7 days) if you track fast-moving competitors, or raise it (e.g., 30 days) if you mostly review historical reports and want to minimize API usage.
* **For team workflows**, pair this with [S3 Cache for DataForSEO Data](/guide/data-sharing-with-s3.md) so your teammates also benefit from your API calls.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.seoutils.app/guide/recent-searches-and-cache.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
