最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

server side rendering - Angular Universal Hydration HttpTransferState always using cache - Stack Overflow

programmeradmin0浏览0评论

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".

发布评论

评论列表(0)

  1. 暂无评论