Purpose of TransferHttpCacheModule when using BrowserTransferStateModule

Viewed 1899

I am working on an Angular Universal application and trying to prevent duplicate HTTP calls on server/client in the most efficient way possible. I have been able to accomplish the task by utilizing ServerTransferStateModule on app.server.module and BrowserTransferStateModule on app.module. When making my HTTP call, I either get or set a state variable using TransferState.

This works. My question is, what is the purpose of TransferHttpCacheModule because for me it works without using it, but other examples say it's necessary. It does not appear necessary for me so I would like to know how it's supposed to fit in. I appreciate your help!

1 Answers

Ok, I did some more testing and it seems like TransferHttpCacheModule does the job automatically when you're utilizing HttpClient. In my case, I was using Restangular so this didn't work out the box. Thanks. Hope this helps someone in the future.

Related