title: How to use/control RxJava Observable.cache
body: <p>I am trying to use the RxJava caching mechanism ( RxJava2 ) but i can't seem to catch how it works or how can i control the cached contents since there is the <code>cache</code> operator.</p>
  <p>I want to verify the cached data with some conditions before emitting the new data.</p>
  <p>for example</p>
  <pre><code>someObservable.
  repeat().
  filter { it.age &lt; maxAge }.
  map(it.name).
  cache() 
  
  </code></pre>
  <p>How can i check and filter the cache value and emit it if its succeeds and if not then i will request a new value.</p>
  <p>since the value changes periodically i need to verify if the cache is still valid before i can request a new one.</p>
  <p>There is also <code>ObservableCache&lt;T&gt;</code> class but i can't find any resources of using it.</p>
  <p>Any help would be much appreciated. Thanks.</p>