79128673

Date: 2024-10-26 14:02:44
Score: 0.5
Natty:
Report link

**You have to use { cache: 'no-store' } **

it is not working because you are caching for default meaning it is statically rendered,,, indeed it is going to work even if the server is off,, just because it became a static page,, so if you want suspense to work you have to disable that like link bellow const res = await fetch('http://127.0.0.1:8000/api/products/get-featured-products',{ cache: 'no-store' }) const products: ProductParams[] = await res.json()

you see at the end the { cache: 'no-store' } so now it is going to fetch every time,, but remember it is better to have it as a static page so it is faster and better seo,,,,,

not sure but maybe you will nee to go the .next folder and then to fetch-cache and delete it, so it is going to fetch and you will see your suspense.

again if you dont use {cache:'no-store} you will see the loading of your suspense just one time,, after that the page will be static meaning even without backend it is going to show up,,,, but if you use {cache:'no-store} you will fetch every time you visit the page and you will see your suspense loading,

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: manuel antunez