From 0a3dd01f1a50b5145cbd7acf573db0f7a3e84c02 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Sat, 10 Nov 2018 16:36:14 +0100 Subject: [PATCH] Prevent browsers from caching images with same filenames from different directories --- slider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slider.py b/slider.py index 52b56a1..382e270 100755 --- a/slider.py +++ b/slider.py @@ -36,7 +36,7 @@ def random_image(): images = list(imgdir.glob(img_glob)) selected_image = choice(images).relative_to(imgdir) - return redirect(url_for("image", filename=selected_image)) + return redirect(url_for("image", filename=selected_image) + "?hash=%s" % get_cache_filename(selected_image)) @app.route("/img/")