title: Cache data but check in the background for new data
body: <p>I want to cache my data, but at the same time I need my data to be up-to-date. I found this: <a href="https://stackoverflow.com/questions/36293938/angular2-easiest-way-to-cache-http-responses">Angular2 easiest way to cache HTTP responses</a> but this will not check for new data.</p>
  
  <p>I have this now in my service:</p>
  
  <pre><code>public publishedSessions: Session[] = null;
  
    getPublishedSessions(): Observable&lt;any&gt; {
      let headers = new Headers();
      headers.append('authorization', this.userService.getToken());
  
      if (this.publishedSessions) {
        this.http.get(this.apiUrl + 'api/sessions/published', {
          headers: headers
        })
          .map(res =&gt; res.json().sessions)
          .subscribe(sessions =&gt; this.publishedSessions = sessions);
  
        return Observable.of(this.publishedSessions);
      } else {
      return this.http.get(this.apiUrl + 'api/sessions/published', {
        headers: headers
      })
        .do(res =&gt; this.publishedSessions = res.json().sessions)
        .map(res =&gt; res.json().sessions)
        .catch((error) =&gt; Observable.of(error));
      }
    }
  </code></pre>
  
  <p>And some standard code in my component:</p>
  
  <pre><code>handlePublishedSessions(): void {
       this.subscriptionArr.push(this.sessionService.getPublishedSessions().subscribe(sessions =&gt; {
        this.session = sessions
    }));
  }
  </code></pre>
  
  <p>This causes the effect that when I first navigate (visit 1) to the page, a call (call 1) will be made (wanted). Then if I navigate away and return back to the page (visit 2), the data from call 1 will be returned (not wanted), in the meantime, call 2 is in the works. So if I then navigate away again and navigate back (visit 3), the data from call 2 is being returned.</p>
  
  <p>I want that the call 1 data is displayed on visit 2 for the first few milliseconds (untill call 2 is done). When call 2 is done I want the data to be replaced (without user interaction).</p>