Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Page rendered both from server and browser #683

Closed
keithazzopardi opened this issue Jun 21, 2019 · 1 comment
Closed

Page rendered both from server and browser #683

keithazzopardi opened this issue Jun 21, 2019 · 1 comment

Comments

@keithazzopardi
Copy link

keithazzopardi commented Jun 21, 2019

I have a situation where the page is being rendered both from the server and both from the browser. I am doing an HTTP call to get content from server.

getContent(): Observable<someObject> {
    console.log(`Getting content by ${this.platformId}`);
    return this.http.get<someObject>('someurl');
  }

When I hit the page, I am able to see "Getting content by server" and "Getting Content by browser". This is causing me an issue whenever I hit the page directly ("CTRL+ F5") because on the browser I am caching the response. Thus, if the value on the server is changed, I will first receive the updated server-side content and then it will switch to the cached content of the browser, causing an undesired flickering effect on the page.

How could I avoid such a situation?

@keithazzopardi
Copy link
Author

I managed to solve this issue by using TransferHttpCacheModule.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant