Closed Lin87 closed 5 years ago
Be sure to test this in a way that assesses if it is an extra burden on slower devices. And loading in sequentially would be best. Not all at once, I think.
Oh yes, definitely. I will load and cache like ~5 images at a time. For example, the first 5 images on page load, when reached page 5, load the next 5 images, and so on.
Rather than loading and caching a few images at a time periodically, a worker service thread (multithreading) is created to preload all slide images on the page load. This worker service thread does not affect the loading time of the presentation, which is on the main thread.
Additional image caching controls are added to retain a degree of freshness. That is, cache the image for 1 hour and allow the use of cached images for 2 hours before revalidating with the server. Also, cached images are not stored. In short, the images are cached during the session of user activity.
Have the images used in the presentation preloaded and cached to avoid image loading situation when the presentation is in progress.