GithubHelp home page GithubHelp logo

Comments (9)

jbaxleyiii avatar jbaxleyiii commented on April 27, 2024

➤ meteor-bot commented:

@mhuggins: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

from apollo-link-state.

jbaxleyiii avatar jbaxleyiii commented on April 27, 2024

➤ James Baxley commented:

@mhuggins the desired behavior for SSR is to fetch the first time, then to read from the cache during the second loop when creating the components. Since react-apollo uses a two round render on the server, it is important to not send queries (force-fetch) the second time around

from apollo-link-state.

jbaxleyiii avatar jbaxleyiii commented on April 27, 2024

➤ Matt Huggins commented:

@jbaxleyiii By using cache on the server, every subsequent request has stale data since the underlying DB may be updating regularly while the apollo cache maintains an older version. How do you make the cache bust between requests?

from apollo-link-state.

jbaxleyiii avatar jbaxleyiii commented on April 27, 2024

➤ milanvdmria commented:

@jbaxleyiii It mainly doesn't make sense when you are also using Apollo to validate some user input. The user enters a certain product, the front end logic changes based on the fact if that product already exists yes or no.
If the caching strategy is forced, the check will always be performed on the very first product the user wants to add and all the consequent products are never correctly checked.

As mentioned in the PR, this forced caching strategy is causing unexpected behavior and issues for quite some people without adding extra value. What could possibly be the advantage of taking away some configuration options from the user?

from apollo-link-state.

jbaxleyiii avatar jbaxleyiii commented on April 27, 2024

➤ Mateusz Bagiński commented:

@mhuggins @milanvdmria ping

from apollo-link-state.

jbaxleyiii avatar jbaxleyiii commented on April 27, 2024

➤ Matt Huggins commented:

Not sure why I'm being pinged.

from apollo-link-state.

jbaxleyiii avatar jbaxleyiii commented on April 27, 2024

➤ Mateusz Bagiński commented:

Any changes?

from apollo-link-state.

jbaxleyiii avatar jbaxleyiii commented on April 27, 2024

➤ Matt Huggins commented:

My recommended change is in this PR.

from apollo-link-state.

jbaxleyiii avatar jbaxleyiii commented on April 27, 2024

➤ Kay Sackey commented:

@jbaxleyiii Typically the client/server implementations will diverge quite a bit during the setup-phase of the app by necessity.

Even, React itself doesn't have an identical API for rendering on the server, versus attaching to the DOM.

Accordingly, I think the best practice would be creating a server-side apollo client without caching, and a client-side apollo client with caching. Having the option being forced without warning was a bit surprising, especially since the vanilla client doesn't do this.

from apollo-link-state.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.