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

[⚡ Feature]: Add Next 15.0.3 Fetch cache support. #913

Open
1 task
rohanrehman opened this issue Dec 5, 2024 · 0 comments
Open
1 task

[⚡ Feature]: Add Next 15.0.3 Fetch cache support. #913

rohanrehman opened this issue Dec 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@rohanrehman
Copy link

rohanrehman commented Dec 5, 2024

Description

previously, cache was on by default.

let posts:any = await fetch('https://domain.com/posts').then((res) => res.json())

Updated method to opt-in for cache as per NEXTjs's documentation

  let posts:any = await fetch('https://domain.com/posts',
    {cache:"force-cache",
      next:{
       revalidate: 3600//3600=1hr
      }
    }).then((res) => res.json())

Additional Information

Adding the new method causes the fllowing error :

 "logs": [
    {
      "message": [
        "Error: The 'cache' field on 'RequestInitializerDict' is not implemented."
      ],
      "level": "error",
      "timestamp": 1733359252751
    }
  ],

Would you like to help?

  • Would you like to help implement this feature?
@rohanrehman rohanrehman added the enhancement New feature or request label Dec 5, 2024
@rohanrehman rohanrehman changed the title [⚡ Feature]: Add Next 15 Fetch cache support. [⚡ Feature]: Add Next 15.0.3 Fetch cache support. Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant