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

Improve prefetch conditions #5244

Merged
merged 2 commits into from
Nov 1, 2022
Merged

Conversation

deeprobin
Copy link
Contributor

I took a general look at the prefetch package and found that prefetching doesn't make sense in some cases.
For example, when the browser is offline.
Also, 3G is a relatively slow connection over which, in my opinion, no prefetching should be done.

Changes

  • Only prefetch when browser is online
  • Only prefetch when browser is not 2G/3G
  • Minor style changes / partly happen automatically by the linter

Testing

Tests passing

Docs

No docs required

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2022

🦋 Changeset detected

Latest commit: 105dd4c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@deeprobin deeprobin changed the title Prefetch improvements Improve prefetch conditions Oct 28, 2022
@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Oct 28, 2022
Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks

@matthewp matthewp merged commit 6ad91bd into withastro:main Nov 1, 2022
@astrobot-houston astrobot-houston mentioned this pull request Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants