Pregunta

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?

¿Fue útil?

Solución 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.

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top