Closed Secozzi closed 4 months ago
what do you mean by the client will load the images again when scrolled into view
?
are they actually getting requested again from the server or are they loaded from the cache?
According to devtools, they're requested twice. Once when the entire list gets preloaded, then again when the page is scrolled into view
are they requested twice because they show up twice in the devtools or are they requested twice because the second request was actually fulfilled by the server instead of being served from the cache?
because it works as expected for me - if the first request was successful the second request will just get served from the cache, as can be seen in the "Fulfilled by" column of the request
The second request appears to be request twice, the transferred column doesn't mention anything about cache, and when scrolling into view there's a loading circle before the page is loaded.
I can't reproduce this, please provide a screenshot from the network tab where this is the case
this is caused by the service worker that is registered, which the webUI does not provide itself, I assume you served VUI at some point via the server
you have to remove the server worker for it to work properly, go to the application tab > serverice worker and unregister it
Ah, after unregistering that the images are being cached correctly.
On another note, it still tries to preload the entire list of pages as shown in the video, and if i understood https://github.com/Suwayomi/Suwayomi-WebUI/issues/662#issuecomment-2010155444 correctly it should only preload a set number of images, should it not?
there is currently no lazy loading for preloading pages
it will just request all pages, but only 5 images will be requested in parallel, so in case the reader gets left or the chapter gets changed, all queued/running image requests get canceled
so for preloading only n pages ahead, a feature request should be opened
with #722 the service worker gets unregistered now, so this should not happen anymore and the server should not get spammed with image requests
I'll close this bug issue with #722 being integrated, as mentioned for the "preloading only n pages ahead" functionality, please create a feature request
I see, thanks for the clarification
Device information
Steps to reproduce
Expected behavior
Only a set number of images should be preloaded
Actual behavior
The entire list gets preloaded, and the client will load the images again when scrolled into view. (The server doesn't load the images twice)