[X] I verified that the issue exists in the latest next-safe-action release
Is there an existing issue for this?
[x] I have searched the existing issues and found nothing that matches
Describe the bug
Next.js automatically caches fetch requests, but for some reason, when using next-safe-action, the fetch requests aren't being cached. I know that I can implicitly force the caching, but this shouldn't be the normal behavior.
I have the following code defined in my /lib/server-actions.ts file:
When accessing this page, I can see in the log that the cache is skipped:
GET https://jsonplaceholder.typicode.com/posts 200 in 450ms (cache: SKIP)
│ │ Cache missed reason: (auto cache)
I tried using a regular Next.js server action instead the one created using next-safe-action, and the caching worked perfectly fine, I could see that the cache is indeed being hit.
Is this the normal behavior? or there's some kind of interference with the cache?
Reproduction steps
Mentioned above.
Expected behavior
The next safe action shouldn't skip the cache, it should act as a regular Next.js server action, which automatically caches fetch requests.
Are you using the latest version of this library?
Is there an existing issue for this?
Describe the bug
Next.js automatically caches fetch requests, but for some reason, when using next-safe-action, the fetch requests aren't being cached. I know that I can implicitly force the caching, but this shouldn't be the normal behavior.
I have the following code defined in my /lib/server-actions.ts file:
As you can see this is a simple server action with no validations whatsoever.
I'm calling this action in my page.tsx file as follows:
When accessing this page, I can see in the log that the cache is skipped:
I tried using a regular Next.js server action instead the one created using next-safe-action, and the caching worked perfectly fine, I could see that the cache is indeed being hit.
Is this the normal behavior? or there's some kind of interference with the cache?
Reproduction steps
Mentioned above.
Expected behavior
The next safe action shouldn't skip the cache, it should act as a regular Next.js server action, which automatically caches fetch requests.
Reproduction example
N/A
Operating System
Windows 10
Library version
6.1.0
Additional context
No response