Skip to content

garbage-collect old episodes #39

@regular

Description

@regular

The prevent browsers from becoming unresponsive when there is a large number of episodes in the dom that display complex, interactive content, we need to be able to temporarily replacecurrently unseen episodes with a placeholder.

If an episode's bottom border is far enough from the top border of the viewport, we can assume that it will not come into view for some time. We then replace it with a placeholder of the same dimensions (to prevent the content below from jumping).

The placeholder contains a spinner.

When it comes into view, we simply re-load the episode and it will de-serialize it's state just like during app startup.

On app startup, instead of loading episodes, we put their placeholders into the dom. This will prevent old episodes from being loaded at all. This requires to maintain a database of episode heights. Note: the dimensions are not constant, an episode can grow and shrink in size. It is probably save to assume that the size only changes in response to a change in state of the respective episode, thus we can update the heightdb whenever the episode serializes it's state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions