Cloudflare Deployment · Nuxt AI Ready · Nuxt SEO

[NuxtSEO Pro](https://nuxtseo.com/ "Home")

- [Modules](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)
- [Tools](https://nuxtseo.com/tools)
- [Pro](https://nuxtseo.com/pro)
- [Learn SEO](https://nuxtseo.com/learn-seo/nuxt) [Releases](https://nuxtseo.com/releases)

[Sign In](https://nuxtseo.com/auth/github)

[Nuxt SEO on GitHub](https://github.com/harlan-zw/nuxt-seo)

[User Guides](https://nuxtseo.com/docs/ai-ready/getting-started/introduction)

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

[Releases](https://nuxtseo.com/docs/ai-ready/releases/v1)

AI Ready

- [Switch to AI Ready](https://nuxtseo.com/docs/ai-ready/getting-started/introduction)
- [Switch to Nuxt SEO](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)
- [Switch to Robots](https://nuxtseo.com/docs/robots/getting-started/introduction)
- [Switch to Sitemap](https://nuxtseo.com/docs/sitemap/getting-started/introduction)
- [Switch to OG Image](https://nuxtseo.com/docs/og-image/getting-started/introduction)
- [Switch to Schema.org](https://nuxtseo.com/docs/schema-org/getting-started/introduction)
- [Switch to Link Checker](https://nuxtseo.com/docs/link-checker/getting-started/introduction)
- [Switch to SEO Utils](https://nuxtseo.com/docs/seo-utils/getting-started/introduction)
- [Switch to Site Config](https://nuxtseo.com/docs/site-config/getting-started/introduction)
- [Switch to Skew Protection](https://nuxtseo.com/docs/skew-protection/getting-started/introduction)

Search…```k`` /`

v1.1.2

- [Discord Support](https://discord.com/invite/275MBUBvgP)

### Getting Started

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

### Core Concepts

- [AI Content Signals](https://nuxtseo.com/docs/ai-ready/guides/content-signals)
- [llms.txt Generation](https://nuxtseo.com/docs/ai-ready/guides/llms-txt)
- [Markdown Conversion](https://nuxtseo.com/docs/ai-ready/guides/markdown)
- [Model Context Protocol (MCP)](https://nuxtseo.com/docs/ai-ready/guides/mcp)
- [Runtime Sync (Optional)](https://nuxtseo.com/docs/ai-ready/guides/runtime-indexing)
- [Cloudflare Deployment](https://nuxtseo.com/docs/ai-ready/guides/cloudflare)
- [IndexNow](https://nuxtseo.com/docs/ai-ready/guides/indexnow)
- [CLI](https://nuxtseo.com/docs/ai-ready/guides/cli)

### Advanced

- [RAG Setup](https://nuxtseo.com/docs/ai-ready/advanced/rag-example)

Core Concepts

# Cloudflare Deployment

[Copy for LLMs](https://nuxtseo.com/docs/ai-ready/guides/cloudflare.md)

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

## [Setup](#setup)

### [1. Create D1 Database](#_1-create-d1-database)

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

This outputs your database ID:

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

### [2. Configure wrangler.toml](#_2-configure-wranglertoml)

wrangler.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](#_3-configure-module)

nuxt.config.ts

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

## [How It Works](#how-it-works)

```
┌────────────────────────────────────────────────────────────┐
│ 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](#nuxthub)

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

nuxt.config.ts

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

## [Scheduled Tasks (Cron)](#scheduled-tasks-cron)

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

### [Cloudflare Workers](#cloudflare-workers)

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

nuxt.config.ts

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

### [Cloudflare Pages](#cloudflare-pages)

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

nuxt.config.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, etc.):

GitHub Actions

cURL

```
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"
```

```
# One-time sync
curl -H "Authorization: Bearer YOUR_SECRET" -X GET "https://yoursite.pages.dev/__ai-ready/cron"

# Or just restore from prerendered dump (faster, no re-indexing)
curl -H "Authorization: Bearer YOUR_SECRET" -X POST "https://yoursite.pages.dev/__ai-ready/restore"
```

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

## [Notes](#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`

[Edit this page](https://github.com/nuxt-seo-pro/nuxt-ai-ready/edit/main/docs/content/2.guides/5.cloudflare.md)

[Markdown For LLMs](https://nuxtseo.com/docs/ai-ready/guides/cloudflare.md)

Did this page help you?

### 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)

On this page

- [Setup](#setup)
- [How It Works](#how-it-works)
- [NuxtHub](#nuxthub)
- [Scheduled Tasks (Cron)](#scheduled-tasks-cron)
- [Notes](#notes)

[GitHub](https://github.com/harlan-zw/nuxt-seo) [ Discord](https://discord.com/invite/275MBUBvgP)

### [NuxtSEO](https://nuxtseo.com/ "Home")

- [Getting Started](https://nuxtseo.com/docs/nuxt-seo/getting-started/introduction)
- [MCP](https://nuxtseo.com/docs/nuxt-seo/guides/mcp)

Modules

- [Robots](https://nuxtseo.com/docs/robots/getting-started/introduction)
- [Sitemap](https://nuxtseo.com/docs/sitemap/getting-started/introduction)
- [OG Image](https://nuxtseo.com/docs/og-image/getting-started/introduction)
- [Schema.org](https://nuxtseo.com/docs/schema-org/getting-started/introduction)
- [Link Checker](https://nuxtseo.com/docs/link-checker/getting-started/introduction)
- [SEO Utils](https://nuxtseo.com/docs/seo-utils/getting-started/introduction)
- [Site Config](https://nuxtseo.com/docs/site-config/getting-started/introduction)
- [Skew Protection](https://nuxtseo.com/docs/skew-protection/getting-started/introduction)
- [AI Ready](https://nuxtseo.com/docs/ai-ready/getting-started/introduction)

### [NuxtSEO Pro](https://nuxtseo.com/pro "Nuxt SEO Pro")

- [Getting Started](https://nuxtseo.com/pro)
- [Dashboard](https://nuxtseo.com/pro/dashboard)
- [Pro MCP](https://nuxtseo.com/pro/docs/getting-started/mcp-setup)

### [Learn SEO](https://nuxtseo.com/learn-seo "Learn SEO")

Nuxt

- [Mastering Meta](https://nuxtseo.com/learn-seo/nuxt/mastering-meta)
- [Controlling Crawlers](https://nuxtseo.com/learn-seo/nuxt/controlling-crawlers)
- [Launch & Listen](https://nuxtseo.com/learn-seo/nuxt/launch-and-listen)
- [Routes & Rendering](https://nuxtseo.com/learn-seo/nuxt/routes-and-rendering)
- [Staying Secure](https://nuxtseo.com/learn-seo/nuxt/routes-and-rendering/security)

Vue

- [Vue SEO Guide](https://nuxtseo.com/learn-seo/vue)
- [Mastering Meta](https://nuxtseo.com/learn-seo/vue/mastering-meta)
- [Controlling Crawlers](https://nuxtseo.com/learn-seo/vue/controlling-crawlers)
- [SPA SEO](https://nuxtseo.com/learn-seo/vue/spa)
- [SSR Frameworks](https://nuxtseo.com/learn-seo/vue/ssr-frameworks)
- [SEO Checklist](https://nuxtseo.com/learn-seo/checklist)
- [Pre-Launch Warmup](https://nuxtseo.com/learn-seo/pre-launch-warmup)
- [Backlinks & Authority](https://nuxtseo.com/learn-seo/backlinks)

### [Tools](https://nuxtseo.com/tools "SEO Tools")

- [Social Share Debugger](https://nuxtseo.com/tools/social-share-debugger)
- [Robots.txt Generator](https://nuxtseo.com/tools/robots-txt-generator)
- [Meta Tag Checker](https://nuxtseo.com/tools/meta-tag-checker)
- [HTML to Markdown](https://nuxtseo.com/tools/html-to-markdown)
- [XML Sitemap Validator](https://nuxtseo.com/tools/xml-sitemap-validator)
- [Schema.org Validator](https://nuxtseo.com/tools/schema-validator)
- [Keyword Idea Generator](https://nuxtseo.com/tools/keyword-generator)
- [Keyword Research](https://nuxtseo.com/tools/keyword-research)
- [SERP Analyzer](https://nuxtseo.com/tools/serp-analyzer)
- [Domain Rankings](https://nuxtseo.com/tools/domain-rankings)

Copyright © 2023-2026 Harlan Wilton - [MIT License](https://github.com/harlan-zw/nuxt-seo/blob/main/license) · [mdream](https://mdream.dev)