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

garbage-collect old episodes #39

Open
regular opened this issue Jun 17, 2015 · 0 comments
Open

garbage-collect old episodes #39

regular opened this issue Jun 17, 2015 · 0 comments

Comments

@regular
Copy link
Contributor

regular commented Jun 17, 2015

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.

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