在Firestore中是否存在某种查询缓存?

假设我有一个包含此OnInit查询的组件:

ngOnInit() {
 this.afs.collection('user_previews', ref => {
   return ref.where('location', '==', 'bar')
 })
  .valueChanges()
  .first()
  .subscribe(snap => console.log(snap));
}

到目前为止,这返回了正确的UserPreviews数组,非常好 .

然后,站点中另一个完全不同的组件执行另一个查询:

ngOnInit() {
  this.afs.collection('user_previews', ref => ref.where('id', '==', 'foo'))
      .valueChanges()
      .subscribe(snap => console.log(snap));
  }

这将通过不同的查询从同一集合返回自己的数据 . 数据还可以 .

然后发生奇怪的行为......当我导航回第一个组件时,其查询返回的数据始终是第二个组件返回的数据 . 这些组件不是兄弟姐妹或以任何方式传达 .