Reputation: 882
We have encountered a strange error in one of our projects. On our live server one GET request suddenly started to always return an empty value. On our test server everything worked fine.
We found out that some npm packages were cached on the test server. After clearing that the same behaviour started there.
We noticed that the issue is caused by the hydration feature of Angular Universal, that returns the responses of GET request made on the server to the client. Usually this worked fine, so the first request in the browser returned the cached value and the second request to the same url in the browser made an actual request to the API again. But somehow this does not seem to work anymore. Now always the same cached response is returned even when it's the third or fourth request. We used Angular 15 and updated to 16 but it still doesn't seem to work. I also excluded all external libraries but had no luck.
Does anyone know how this can be analyzed or what can be the problem? I read something about that the cached value is returned as long as the app is not "stable".
Upvotes: 1
Views: 39