Weird cache behavior

I created a new t3 app with app router and trpc. Then I moved CrudShowCase (including the get posts part) to a new route. I realized a weird behavior after adding artificial delay to the get posts api.

  1. On initial visit - fetch data from source and takes a while
  2. On subsequent visits < 30s: instant page load due to cache
  3. On first visit after 30s - fetch data from source and takes a while
  4. All visits from here on - fetch data from source and takes a while.
The discrepancy/unexpected outcome is 4. I thought 4 should be the same as 2, in that the cache is reset to the 30s timer and the user would get instant page loads again. But that is not the case. Can someone confirm this is expected or non-expected behavior?
Was this page helpful?