Im having a problem where breeze always goes to the server even though I've specified FetchStrategy.FromLocalCache. I created a test script below. Th initial query goes remote as as expected. The second query also goes remote(FetchStrategy.FromLocalCache). The third query(ExecuteQueryLocally) goes to local cache. From developer tools I can see there are 2 network requests (not including metadata). What am I doing wrong?
getCategories = function (observable) {
var query = breeze.EntityQuery
.from("Categories")
.orderBy('Order');
manager.executeQuery(query) //goes remote
.then(fetchSucceeded)
.fail(queryFailed);
function fetchSucceeded(data) {
// observable(data.results);
getCategoriesLocal(observable);
}
},
getCategoriesLocal = function (observable) {
var query = breeze.EntityQuery
.from("Categories")
.orderBy('Order');
query.using(breeze.FetchStrategy.FromLocalCache);
manager.executeQuery(query) //also goes remote
.then(fetchSucceeded)
.fail(queryFailed);
function fetchSucceeded(data) {
d = manager.executeQueryLocally(query); //goes local
observable(d);
return;
}
},