Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ssrForceFetchDelay work with cache-and-network #3491

Closed
wants to merge 1 commit into from
Closed

Make ssrForceFetchDelay work with cache-and-network #3491

wants to merge 1 commit into from

Conversation

ciscorn
Copy link

@ciscorn ciscorn commented May 21, 2018

Under SSR, we can use the ssrForceFetchDelay option to prevent the browser from issuing the same network requests that the server-side already has done.

this.disableNetworkFetches = ssrMode || ssrForceFetchDelay > 0;

However, this option currently works only with network-only:

if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {
options = { ...options, fetchPolicy: 'cache-first' } as WatchQueryOptions;
}

I think this option should also work with cache-and-network.

@apollo-cla
Copy link

@ciscorn: 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/

@apollo-cla
Copy link

Fails
🚫

No CHANGELOG added.

Warnings
⚠️

There are library changes, but not tests. That's OK as long as you're refactoring existing code

Generated by 🚫 dangerJS

@dastoori
Copy link
Contributor

I think this PR is related to #2119. I had the same issue and I've already sent a PR (#3372) (I don't know which one is better 🤔)

@ciscorn
Copy link
Author

ciscorn commented May 23, 2018

@dastoori Thanks.
I missed your PR (#3372) , which is exactly same as mine.
I'll close this.

@ciscorn ciscorn closed this May 23, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants