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

Optimize loading of utterance #21

Open
TysonMN opened this issue Dec 10, 2020 · 0 comments
Open

Optimize loading of utterance #21

TysonMN opened this issue Dec 10, 2020 · 0 comments

Comments

@TysonMN
Copy link
Owner

TysonMN commented Dec 10, 2020

When a blog post is loaded, the current behavior is that utterance fetches data from GitHub twice: once for the light theme and once for the dark theme. Of course the fetched data is the same in both cases. One the positive side, switching between themes does not cause utterance to fetch any more data from GitHub.

This is not ideal. Theme switches are rare, so the performance on load is the case to optimize.

Better behavior is to fetch data from GitHub once on page load and once each time the theme is switched. Even better behavior is to fetch data once from GitHub on page load, once from GitHub on the first theme switch, and no more fetches on additional theme switches. Best behavior is to fetch data from GitHub once on page load and then never again on any theme switch.

See utterance/utterances#427 for how decided to handle this situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant