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

Enhancement: preload adjacent images. #17

Open
tcoxon opened this issue Mar 17, 2010 · 1 comment
Open

Enhancement: preload adjacent images. #17

tcoxon opened this issue Mar 17, 2010 · 1 comment

Comments

@tcoxon
Copy link
Owner

tcoxon commented Mar 17, 2010

No description provided.

@MatrixFrog
Copy link
Contributor

By "adjacent" I assume you mean that if the user is looking at comic n, then comics n-1 and n+1 are silently loading in the background. I'm starting to get familiar with the code, and it looks to me like the way to do this would be to keep a few instances of ComicInfo around, instead of just the one. Maybe a map from comic numbers to ComicInfos. Then the getComicInfoFromPage method would just return the value from the map, if it's there. If it's not there, then we follow the current implementation and add it to the map when we're done. Technically, this will only cache the image URL, not the image itself, but I suspect that applying the regexes to the HTML to get the image URL is a large part of the slowness, so it's still probably worth doing.

If I'm not mistaken, this would also have the added bonus of automatically caching the image URL for any of the comics the user has already looked at. I hope I'm not totally misunderstanding your code...

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

No branches or pull requests

2 participants