Replies: 2 comments
-
The system is intentional, consequential loading is very slow compared to parallel. That is true that the first image takes more time to load, but it's a trade-off. This is also why the "previous" image is loaded together with the "next" image. The current version of the PhotoSwipe |
Beta Was this translation helpful? Give feedback.
-
Thanx for comment. And what about changing preload order (even it is async) in next releases? [100, 99, 101, 102, 103 ...] should be changed to [100, 101, 99, 102, 103 ...] |
Beta Was this translation helpful? Give feedback.
-
Hello @dimsemenov,
Preload feature of PhotoSwipe is great but can slow down appearance of main clicked image while speeding up load time of next images. At some cases it’s not what is expected from preloading.
I’ve got galleries with hundreds of files with dimensions 2000*2500 and file size of one image about 2MB. These files are scanned documents. Load time of a single file is about 2sec and can be even 5 sec when the server is heavily loaded.
When preload feature is off clicked image load time is 2 sec. But when preload feature is on clicked image load time can increase to 3-4sec and more.
The reason for additional delay in displaying of main image is concurrent loading of several next/previous preloaded files. In some cases next/previous file can be loaded even faster than main image. Or third preloading file can be loaded faster than second preloading file.
I suggest thinking about changing the algorithm of loading “preloaded files”. Async concurrent loading is not the best way in this case probably. I think loading of second file should start only when first file was fully loaded. Loading of third file should start only when second file fully loaded etc.
One more thought. If main file is 100.jpg preloaded files queue is 99.jpg, 101jpg…, «Previous» file comes before “next” file. But users usually press “next” button after seeing main image. So I thing preload order should be 100.jpg (main), 101.jpg (first next), 99 (first previous), 102, 103 …
Please find enclosed screen shots with additional explanation.
Beta Was this translation helpful? Give feedback.
All reactions