fix: use max_age instead of cache_timeout

This commit is contained in:
2023-01-08 23:06:19 +01:00
parent c2b1dcd691
commit 3dc8ff03c5

View File

@@ -89,7 +89,7 @@ def generatePicture(pathToOrig, scaleX, scaleY, encoding, crop):
@app.route("/image/<path:path>") @app.route("/image/<path:path>")
@app.route("/images/<path:path>") @app.route("/images/<path:path>")
def sendPicture(path): def sendPicture(path):
cache_timeout = 2592000 max_age = 2592000
y1 = flask.request.args.get("scaley") y1 = flask.request.args.get("scaley")
x1 = flask.request.args.get("scalex") x1 = flask.request.args.get("scalex")
@@ -118,7 +118,7 @@ def sendPicture(path):
if not path: if not path:
return ("File not found: {}".format(os.path.join(PICTURE_DIR, pathDebug)), 404) return ("File not found: {}".format(os.path.join(PICTURE_DIR, pathDebug)), 404)
raw = flask.send_from_directory(".", path, cache_timeout=cache_timeout) raw = flask.send_from_directory(".", path, max_age=max_age)
response = flask.make_response(raw) response = flask.make_response(raw)
response.headers['X-PICTURE-FACTORY-INTERNAL-FID'] = path response.headers['X-PICTURE-FACTORY-INTERNAL-FID'] = path