How to fetch data and cache it until midnight

22 Views Asked by At

I have a method which returns the count of users registered during last 24 hours. I want to call it only once a day, i.e. call it and cache results untill midnight. I'm using tanstack-query for data fetching and the app is written in NextJS. Is it possible?

0

There are 0 best solutions below