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

http requests being called twice #32

Closed
3 of 8 tasks
mogusbi opened this issue Jun 4, 2017 · 2 comments
Closed
3 of 8 tasks

http requests being called twice #32

mogusbi opened this issue Jun 4, 2017 · 2 comments

Comments

@mogusbi
Copy link

mogusbi commented Jun 4, 2017

Note: for support questions, please use the Universal Slack Channcel or https://gitter.im/angular/universal

  • I'm submitting a ...
  • bug report
  • feature request
  • Which parts of preboot are affected by this issue?
  • server side
  • client side
  • inline
  • build process
  • docs
  • tests
  • Do you want to request a feature or report a bug?
    Report a bug

  • What is the current behavior?
    When loading a page with preboot installed, http calls are being run twice, once by the server and then again when the client app takes over.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem by creating a github repo.

  1. Load a page which makes a http call (in this case using a resolve using the router)
  2. The page is correctly loaded but when checking logs, you will notice that the http call has been made twice

image

  • What is the expected behavior?
    The data to be cached instead of the request being called twice

  • Please tell us about your environment:

  • Browser: [Chrome 58.0.3029.110 (64-bit)]
  • Language: [TypeScript 2.3.4]
  • OS: [Mac OS X]
  • Platform: [NodeJs 6.9.4]
@marekstabla
Copy link

@mogusbi Checkout transfer-state module here:
https://github.com/FrozenPandaz/ng-universal-demo/tree/master/src/modules

This is not preboot issue.

@jeffwhelpley
Copy link
Contributor

Yes, as @marekstabla mentions, you need to cache data between the server and client which requires the transfer state module. Preboot is just focused on the events between the server view and client view (i.e. if someone clicks on something in the server view before the client view finishes bootstrapping).

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

3 participants