Prevent browsers from caching images with same filenames from different directories
This commit is contained in:
parent
bc0ee53d88
commit
0a3dd01f1a
@ -36,7 +36,7 @@ def random_image():
|
|||||||
images = list(imgdir.glob(img_glob))
|
images = list(imgdir.glob(img_glob))
|
||||||
selected_image = choice(images).relative_to(imgdir)
|
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/<path:filename>")
|
@app.route("/img/<path:filename>")
|
||||||
|
Reference in New Issue
Block a user