mirror of
https://github.com/FAUSheppy/python-flask-picture-factory
synced 2025-12-06 07:01:37 +01:00
fix: use max_age instead of cache_timeout
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user