Possible to load without caching? #588
-
When using different images with the same name our browsers cache the image meaning the user has to update the page without cache to see their actual image. Is there a way to prevent this? Could there be a parameter to change in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Sure, you can do that. One common approach is to add some dummy argument to the image source: image = ui.image('https://picsum.photos/200/300.jpg').classes('w-40')
ui.button('Update').on('click', lambda: image.set_source(f'https://picsum.photos/200/300.jpg?t={time.time()}')) See https://stackoverflow.com/a/729623/3419103 for a more detailed explanation. |
Beta Was this translation helpful? Give feedback.
-
is there a way to do this timestamp trick to base64 images? My browser is still caching those to memory for my interactive images. |
Beta Was this translation helpful? Give feedback.
Sure, you can do that. One common approach is to add some dummy argument to the image source:
See https://stackoverflow.com/a/729623/3419103 for a more detailed explanation.