Caching images ahead of time

Can someone recommend a way that I can cache all the images used in my wiki as the user is clicking away/reading tiddlers/etc? I know that each image will be cached as it is displayed but I was hoping to have some background task to get all images and cache them so as to speed up thumbnail lists for large numbers of artworks.

Maybe via a hidden tiddler?

If it is implemented through a tiddler, what happens when the tiddler loses focus, would the download stop?

bobj

You can speed up artwork thumbnails, if you create thumbnails with a lower resolution, so they will be loaded much faster.

If the thumbnails have the same name as the larger images, you can derive that name from the tiddler titles. So preloading should not be necessary.

Mario

Yes I am aware that reducing image size will speed up loading. In fact the images I use are already reduced in size as the originals are full sized 350dpi images and these are 528x528 140 dpi images.

Still wondering if there is a way to cache behind the scenes though.

One thought. On the opening tiddler , have a list all script enveloped by a style=hidden stylesheet.

Bobj

ELS edit: removed personal identifying info (address + phone number)

Bob,

If all images in a given html page can be cached in a browser in advance perhaps something can be done to put the nessasary cache request in a raw tagged tiddler so the images are also cached for use in the tiddlywiki html file.

As long as the same address is used when actually viewing the image it should be retrieved from the browsers cache.

What I am suggesting is using the generic html image caching mechanism to do it within the special case of a tiddlywiki html file.

My question would be is your browser already caching the images or only if they are viewed, if not how can you ask for them to be cached in the browser before viewing without impacting load time?

Cloudflare may also assist here as I suggested previously but not just for you but international visitors will have them cached nationaly.

@TW_Tones , I remember your comment from a previous query re cloudfare and its siblings. These are outside my financial ability for projects that I undertake as most are freebies.

I will just have to stick to latency with bulk image loading. At least when/if the user returns next time, there should still be images in their cache.

bobj

1 Like

The free CloudFlare is sufficient here as well :nerd_face: