---
title: "Sitemap Performance"
description: "Use the default cache engine to keep your sitemaps fast."
canonical_url: "https://nuxtseo.com/docs/sitemap/advanced/performance"
last_updated: "2026-05-25T04:21:47.545Z"
---

## Introduction

For apps with 100k+ pages, generating a sitemap can be a slow process. As robots will request your sitemap frequently, it's important to keep it fast.

Nuxt SEO provides a default cache engine to keep your sitemaps fast and recommendations on how to improve performance.

## Performance Recommendations

When dealing with many URLs that are being generated from an external API, the best option is use the `sitemaps`
option to create [Named Sitemap Chunks](/docs/sitemap/guides/multi-sitemaps).

Each sitemap should contain its own `sources`, this allows other sitemaps to be generated without waiting for this request.

```ts
export default defineNuxtConfig({
  sitemap: {
    sitemaps: {
      posts: {
        sources: [
          'https://api.something.com/urls'
        ]
      },
    },
  },
})
```

If you need to split this up further, you should consider chunking by the type and some pagination format. For example,
you can paginate by when posts were created.

```ts
export default defineNuxtConfig({
  sitemap: {
    sitemaps: {
      posts2020: {
        sources: [
          'https://api.something.com/urls?filter[yearCreated]=2020'
        ]
      },
      posts2021: {
        sources: [
          'https://api.something.com/urls?filter[yearCreated]=2021'
        ]
      },
    },
  },
})
```

Additionally, you may want to consider the following experimental options that may help with performance:

- `experimentalCompression` - Gzip's and streams the sitemap
- `experimentalWarmUp` - Creates the sitemaps when Nitro starts

### Very large sites (100k+ URLs)

For sites at this scale, two practices matter most:

1. **Cache the source endpoint.** Use `defineCachedEventHandler` on any `/api/*` route fed into `sources`. Without this, every cache miss (and every fresh chunk) re-hits your backend.
2. **Set generous chunk sizes.** Search engines accept up to 50,000 URLs per file. The default `defaultSitemapsChunkSize` of 1000 generates 50× more chunks than necessary; bumping to `5000`–`50000` directly reduces total work and cache entries.

Within a single sitemap, all chunks share one resolved-URLs computation (sources are fetched, normalised, and sorted once per `cacheMaxAgeSeconds` window — not once per chunk). Splitting one large sitemap into per-shard sitemaps (e.g. one per locale or content type) is still useful when shards have different cache lifetimes or different sources.

## Zero Runtime Mode

If your sitemap URLs only change when you deploy (not at runtime), you can enable `zeroRuntime` to generate sitemaps at build time and eliminate sitemap generation code from your server bundle.

```ts
export default defineNuxtConfig({
  sitemap: {
    zeroRuntime: true
  }
})
```

This reduces server bundle size by ~50KB. The sitemap is generated once at build time and served as a static file.

See the [Zero Runtime](/docs/sitemap/guides/zero-runtime) guide for details.

## Sitemap Caching

Caching your sitemap can help reduce the load on your server and improve performance.

By default, SWR caching is enabled on production environments and sitemaps will be cached for 10 minutes.

This is configured by overriding your route rules and leveraging the native Nuxt caching.

### Cache Time

You can change the cache time by setting the `cacheMaxAgeSeconds` option. This affects the `Cache-Control` header sent to browsers and search engines.

```ts
export default defineNuxtConfig({
  sitemap: {
    cacheMaxAgeSeconds: 3600 // 1 hour
  }
})
```

If you want to disable caching, set `cacheMaxAgeSeconds` to `false` or `0`.

`cacheMaxAgeSeconds` controls both the HTTP `Cache-Control` header and the server-side SWR cache TTL. For high-volume sites, raising it to several hours significantly reduces origin load.

### Cache Driver

The cache engine is set to the Nitro default of the `cache/` path.

If you want to customise the cache engine, you can set the `runtimeCacheStorage` option.

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  sitemap: {
    // cloudflare kv binding example
    runtimeCacheStorage: {
      driver: 'cloudflare-kv-binding',
      binding: 'OG_IMAGE_CACHE'
    }
  }
})
```
