---
title: "Cloudflare Deployment · Nuxt AI Ready · Nuxt SEO"
canonical_url: "https://nuxtseo.com/docs/ai-ready/guides/cloudflare"
last_updated: "2026-08-16T09:50:30.703Z"
meta:
  description: "Deploy with Cloudflare D1 for persistent database storage."
  "og:description": "Deploy with Cloudflare D1 for persistent database storage."
  "og:title": "Cloudflare Deployment · Nuxt AI Ready · Nuxt SEO"
---

Nuxt SEO on GitHub

Switch to AI ReadySwitch to Nuxt SEOSwitch to RobotsSwitch to SitemapSwitch to OG ImageSwitch to Schema.orgSwitch to Link CheckerSwitch to SEO UtilsSwitch to Site ConfigSwitch to Skew Protection

**Core Concepts**

# **Cloudflare Deployment**

Deploy to Cloudflare Pages/Workers with D1 for persistent database storage.

## Setup

### 1. Create D1 Database

```bash
wrangler d1 create ai-ready-db
```

This outputs your database ID:

```text
Created D1 database: ai-ready-db
Database ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```

### 2. Configure wrangler.toml

wrangler.toml

```toml
name = "my-site"
compatibility_date = "2024-01-01"

[[d1_databases]]
binding = "AI_READY_DB"
database_name = "ai-ready-db"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
```

### 3. Configure Module

nuxt.config.ts

```ts
export default defineNuxtConfig({
  aiReady: {
    database: {
      type: 'd1',
      bindingName: 'AI_READY_DB'
    }
  }
})
```

## How It Works

```text
┌────────────────────────────────────────────────────────────┐
│ BUILD TIME (Local/CI)                                      │
│ Uses SQLite to process pages                               │
│ Creates __ai-ready/pages.dump for initial data             │
├────────────────────────────────────────────────────────────┤
│ FIRST DEPLOYMENT                                           │
│ db-restore plugin imports dump into D1                     │
│ D1 database populated with prerendered pages               │
├────────────────────────────────────────────────────────────┤
│ RUNTIME                                                    │
│ D1 database persists across requests                       │
│ New pages indexed via afterResponse hook                   │
│ FTS5 search works via MCP tools                            │
└────────────────────────────────────────────────────────────┘
```

Key difference from serverless: D1 is persistent, so the module only imports the dump once. Subsequent deployments with updated content will re-import the dump if the database is empty.

## NuxtHub

If using [**~~NuxtHub~~**](https://hub.nuxt.com), D1 is provisioned automatically:

nuxt.config.ts

```ts
export default defineNuxtConfig({
  modules: ['@nuxthub/core'],
  hub: {
    database: true
  },
  aiReady: {
    database: {
      type: 'd1',
      bindingName: 'DB' // NuxtHub default binding
    }
  }
})
```

## Scheduled Tasks (Cron)

Cloudflare Workers supports native cron triggers, but **Cloudflare Pages does not**.

### Cloudflare Workers

When deploying to Cloudflare Workers with `**cron: true**`, the module auto-configures wrangler cron triggers:

nuxt.config.ts

```ts
export default defineNuxtConfig({
  aiReady: {
    cron: true,
    runtimeSyncSecret: process.env.NUXT_AI_READY_RUNTIME_SYNC_SECRET
  }
})
```

### Cloudflare Pages

Cloudflare Pages cannot run scheduled tasks. Use an external cron service to call the cron endpoint:

nuxt.config.ts

```ts
export default defineNuxtConfig({
  aiReady: {
    runtimeSync: true,
    runtimeSyncSecret: process.env.NUXT_AI_READY_RUNTIME_SYNC_SECRET
  }
})
```

Then set up an external cron (GitHub Actions, [**~~cron-job.org~~**](http://cron-job.org), etc.):

```yaml
name: AI Ready Sync
on:
  schedule:
    - cron: '*/5 * * * *' # every 5 minutes
jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - run: >
          curl -H "Authorization: Bearer ${{ secrets.NUXT_AI_READY_RUNTIME_SYNC_SECRET }}"
          -X GET "${{ secrets.SITE_URL }}/__ai-ready/cron"
```

The cron endpoint runs the full sync: restore from dump if needed → seed routes from sitemap → index pending pages → submit to IndexNow.

## Notes

- **Build time**: Always uses [**~~SQLite~~**](https://sqlite.org) (D1 not available during build)
- **Local dev**: Uses SQLite unless using `**wrangler dev**`
- **FTS5**: D1 fully supports FTS5 full-text search
- **Pages cron**: Use external scheduler to call `**/__ai-ready/cron**`

**Was this page helpful?**

### **Related **

[**Installation**](https://nuxtseo.com/docs/ai-ready/getting-started/installation)

[**Runtime Indexing**](https://nuxtseo.com/docs/ai-ready/guides/runtime-indexing)

[**Configuration**](https://nuxtseo.com/docs/ai-ready/api/config)

[**Runtime Sync (Optional)** Opt-in runtime page indexing for sites with dynamic content.](https://nuxtseo.com/docs/ai-ready/guides/runtime-indexing) [**IndexNow** Instantly notify search engines when your content changes.](https://nuxtseo.com/docs/ai-ready/guides/indexnow)