Changing Behavior of revalidateOnMount when Cache is Empty #2916
Unanswered
sehwanforeal
asked this question in
Ideas
Replies: 1 comment
-
Concordo, tive um problema recentemente pois estava em usando uma versão bem antiga e o comportamento era diferente. Posso está tendo o entendimento errado, mas na minha mente as configs revalidateOn... remetem a atualização do cache, nesse caso estamos falando da criação de um novo cache, então essas configs não deveriam ser consideradas. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, when revalidateOnMount is set to false, SWR does not fetch data on component mount, even if the cache is empty.
how about adjusting this behavior?
Even with revalidateOnMount set to false, SWR should initiate a fetch if the cache is empty.
This change aligns more closely with the intuitive use of the library in my opinion. Users leveraging revalidateOnMount: false are often trying to prevent redundant data fetching when the cache is already populated. However, in cases where the cache is empty, it seems within the spirit of SWR's philosophy to fetch data to populate the cache and ensure the application has the necessary data to function properly.
Beta Was this translation helpful? Give feedback.
All reactions