Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page cache - unable to manually control page key naming #1814

Closed
mkierdev opened this issue Oct 10, 2023 · 1 comment
Closed

Page cache - unable to manually control page key naming #1814

mkierdev opened this issue Oct 10, 2023 · 1 comment
Labels

Comments

@mkierdev
Copy link

Environment

Nuxt 3.7

Reproduction

Use built-in Nitro cache and enable it for pages.

export default defineNuxtConfig({
  routeRules: {
    '/': { swr: 3600 }, 
  }
})

Describe the bug

Naming for cached page is not straightforward. It seems that is is using a hashing function. For example, here is the key for index.vue page: nitro:routes::.il7asoJjJE.json_.

It should be possible to control this behavior / manually overwrite it.

Use-case: We would like to control whether or not we should store urlParams inside key.

Additional context

No response

Logs

No response

@pi0
Copy link
Member

pi0 commented Oct 11, 2023

Supporting serializable cache options is in the plan. So with it, you can use keyTemplate to provide a custom key template.

You can follow up on this feature via #1048

@pi0 pi0 closed this as completed Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants