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

# Caching

> Understanding Logo.dev's automatic caching system. Browser caching headers, CDN optimization, and best practices for lightning-fast logo delivery.

## Browser caching

Every logo request includes cache headers that tell browsers to store logos locally for 24 hours:

```http theme={null}
Cache-Control: max-age=86400, stale-while-revalidate=600
```

This happens automatically per user:

1. **First visit** - User's browser downloads logo from Logo.dev CDN
2. **Repeat visits** - Browser serves cached logo instantly (no API call)
3. **After 24 hours** - Browser fetches a fresh logo

`stale-while-revalidate=600` lets the browser keep showing the cached logo for up to 10 minutes past expiry while it fetches the new one in the background, so a refresh never blocks rendering. Each user caches logos on their own device, which cuts API requests and gives instant load times without any setup on your end.

## Refreshing a changed logo

When a company rebrands, the new logo propagates on its own as caches expire: the CDN revalidates in the background, and each browser picks up the change once its own 24-hour cache expires. Between the CDN's own cache and the browser's, propagation can take a bit longer than 24 hours end to end, so don't treat it as a hard deadline. You don't need to do anything for the logo to update eventually.

To force a fresh image right now, add any unique query parameter to the URL. A URL with a new query parameter is treated as a new image and skips the cached copy:

```html theme={null}
<img src="https://img.logo.dev/stripe.com?token=LOGO_DEV_PUBLISHABLE_KEY&v=2" alt="Stripe logo" />
```

Bump the value (`v=2`, a deploy hash, a date) whenever you want to bust the cache. Use this sparingly: each unique URL is a separate cache entry and counts as a request on a miss. For a one-off check that a rebrand has landed, it's the fastest way to see the current logo.

## Best practices

**Preload critical logos:**

```html theme={null}
<link
  rel="preload"
  as="image"
  href="https://img.logo.dev/stripe.com?token=LOGO_DEV_PUBLISHABLE_KEY"
/>
```

**Lazy load below the fold:**

```html theme={null}
<img
  src="https://img.logo.dev/stripe.com?token=LOGO_DEV_PUBLISHABLE_KEY"
  loading="lazy"
  alt="Stripe logo"
/>
```

<Tip>
  Want to store logos on your own infrastructure? Enterprise plans include
  data caching licenses. See [self-hosting](/docs/platform/self-hosting).
</Tip>
