aspnetcore-angular-universal icon indicating copy to clipboard operation
aspnetcore-angular-universal copied to clipboard

two times loading issue - Server doing Http then Client doing it again

Open kannan2106 opened this issue 9 years ago • 3 comments

run your project and refresh this url "http://localhost:65060/users". its loading two times (server side and client side). how to avoid the second time loading?

kannan2106 avatar Apr 11 '17 03:04 kannan2106

It is default behavior as each rendering is separate, but I'll be posting the cache transfer story / example shortly, it is slightly different than the previous 2.x version. I've been swamped apologies for the delay.

MarkPieszak avatar Apr 11 '17 06:04 MarkPieszak

I see that as a feature :)

What I am doing is heavily caching prerendering output. So users get little stale data very fast and app then grabs fresh data using ajax and updates it.

Works great for me!

@MarkPieszak Have you seen somebody promoting this like a pattern? What do you think about it ?

hheexx avatar Apr 11 '17 12:04 hheexx

Not typically, but it always just depends on your Application, whether it's very dynamic in nature, or static etc.

Typically I only put those most important GET Http calls in HttpTransfer logic that reuses them on the client again, just to remove any flicker etc. if calls are very data intensive and take a long Ike to return the result I usually ignore them all together on the server render, and let the client take its time to run them.

Always a million ways you could do any of this stuff right 🙈

I have the working HttpTransfer service/module and Transfer mechanism finished as of last night, just double checking everything and I'll try to get in pushed up to Master this morning. 🎈

MarkPieszak avatar Apr 14 '17 11:04 MarkPieszak