Skip to content

Optimize loading of utterance #21

@TysonMN

Description

@TysonMN

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions