mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-31 18:27:30 +01:00
Set max-age in thumbnails endpoint
This commit is contained in:
parent
b4c508ebab
commit
fa59113cd3
@ -100,5 +100,9 @@ def make_thumbnail(img, level):
|
||||
cache_filepath = os.path.join(output_dir, img)
|
||||
source_filepath = find_source_file(img)
|
||||
|
||||
resize_and_crop(source_filepath, cache_filepath, (w, h))
|
||||
return send_file(cache_filepath)
|
||||
if not os.path.isfile(cache_filepath):
|
||||
resize_and_crop(source_filepath, cache_filepath, (w, h))
|
||||
|
||||
res = send_file(cache_filepath)
|
||||
res.cache_control.max_age = 7*24*60*60
|
||||
return res
|
||||
|
Loading…
Reference in New Issue
Block a user