Question

Using the following two calls for identical resource:

var p1 = Restangular.one('accounts', 123).one('buildings', 456).get();
var p2 = Restangular.one('accounts', 123).one('buildings', 456).get();

Will Restangular send a single GET to the server or two? Is Restangular smart enough to know that there is already a request out to this resource when the second get() is issued?

Edit: Chrome shows only one request go out, but I'm still not sure if this is implemented in Restangular or in the browser?

Was it helpful?

Solution 2

After further investigation is seems that Restangular does not implement a feature to limit requests for same resource. The number of requests that go out to the server is dependent on the browser: Chrome only sends out only one GET request, IE 10 sends out two.

OTHER TIPS

If you add a Cache, it'll also work on IE10 as that URL and its response would be cached.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top