Skip to content

Commit

Permalink
added cache control max_age
Browse files Browse the repository at this point in the history
  • Loading branch information
clemenstyp committed Mar 22, 2024
1 parent 7cf2e2d commit fbbe503
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Snackbar/Frontpage/Titlepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ def initial():
# return render_template('index.html', users=users, current_sorting=sorting)



@app.route('/image/')
@app.route('/image/<filename>')
def image(filename=None):
userID = request.args.get('userID')
return monster_image(filename, userID)
resp = make_response(monster_image(filename, userID))
resp.cache_control.max_age = 86400
return resp


@app.route('/icon/')
@app.route('/icon/<icon>')
def get_icon(icon=None):
return icon_from_folder(icon)
resp = make_response(icon_from_folder(icon))
resp.cache_control.max_age = 86400
return resp


@app.route('/change_image', methods=(['POST']))
Expand Down

0 comments on commit fbbe503

Please sign in to comment.