Open tokee opened 6 years ago
A quick win will be to have the frontend lazy load images when the record is visible in the browser. That way only the top 2-3 records will load images and not all 20.
1) call to images service for the record 2) fetch images
The frontend already does lazy image loading several other places (like image search and gps search).
I am pretty sure that any modern browser already tries to be smart about the load order of images on webpages :wink:
Image search and GPS search are special as they have delayed definition of the image content (as I understand it).
sorry, you talking about playback. I am talking about the image loading for result sets (which is a bottleneck).
When an archived HTML page is displayed, all links its inlined resources needs to be resolved to WARC-files and offsets. For pages with hundreds of such resources, this is a costly process. Currently three methods for resolving are known:
fileserver:WARC#offset
up front and send the re-written HTML to the browser.fileresolver:url:timestamp
up front and send the re-written HTML to the browser.The first method is the fasted, measured in total time, as it performs batch-lookups to map the original links to WARC-entries. Subjectively it is very slow as the user looks at a blank browser-window until the resolving process has finished. The second and third methods are inverse to the first, and might be preferable from an interactive perspective. For thumbnail rendering and similar, the first method is clearly favourable.
A fourth method is hereby suggested, combining the best of both worlds.
a) All links are rewritten to
fileresolver:url:timestamp
and the re-written HTML is delivered, similar to method #2 above. The URLs are also added to an internal queue insolrwayback
. b)solrwayback
keeps a background thread running that resolves thefileresolver:url:timestamp
URLs tofilerserver:WARC#offset
. This is done in FIFO-order and in appropriately sized batches, balancing quick resolving of the beginning of the queue with overall throughput. The result is stored in a map acting as lookup-cache. Non-matches are also stored. c) When the browser requests a resource in the form offileresolver:url:timestamp
, it is either delivered from the lookup-cache, added to the resolver queue. With appropriate checks for existence in the resolver queue as well as waits for resolving.This method makes it possible to tweak interactivity vs. throughput.