Global-signbank icon indicating copy to clipboard operation
Global-signbank copied to clipboard

Make a replaced media file load in the browser immediately after uploading

Open vanlummelhuizen opened this issue 1 year ago • 4 comments

When a media file is replaced, the browser will often not reload the media and retrieve the old version from the browsers cache. We should find a way to make the browser immediately download the newly uploaded media.

One way would be to uniquely name each media file instead of naming it with the text and/or ID of the object it belongs to. When the link to the new media file is used in a web page, the browser will notice it is not yet in the cache and download it.

Note that this is why Django's default method of handling uploaded file is adding a random string to the filename to make it unique.

vanlummelhuizen avatar Oct 04 '23 09:10 vanlummelhuizen