museumsvictoria / nodel

A digital media control system for museums and galleries
nodel.io
60 stars 17 forks source link

<image> element with static source does not update image after first event #280

Closed justparking closed 1 year ago

justparking commented 1 year ago

e.g. given <image event="Webcam Thumnail"/> and local_event_WebcamThumbnail.emit("https://webcams.somewhere/cam1/snapshot.jpg"), the image does not continually update after the first time the event is emitted.

Normally base64 inline content is used (e.g. data:image/jpeg;base64, /9j/4AA....) and the updating works perfectly.

But sometimes direct links are used and the refreshing doesn't work.

morimoriysmoon commented 1 year ago

@justparking It is due to browser cache. It happens with the same URL with different content of image. https://stackoverflow.com/questions/1077041/refresh-image-with-a-new-one-at-the-same-url Please append current date time to image URL to break cache.

local_event_RandomPhoto.emit('https://picsum.photos/200/300?grayscale&_=%s' % date_now())