Skip to content

SWR should accept 0 #4125

@Flo0806

Description

@Flo0806

Environment

Related to this: nuxt/nuxt#34307

swr: 0 should be handled same way like max-age=0.
If I'm correct, I already have a PR ready for Nitro and ocache.

Reproduction

Nuxt config:

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  routeRules: {
    '/**': { swr: 0 },
  },
  compatibilityDate: '2025-07-15',
  devtools: { enabled: true },
});

swr: 0 === swr: false

Describe the bug

swr: 0 should be the same as max-age=0.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions