I was wondering if somehow could help me understand the following snippet of code from the pset distribution code:
# Ensure responses aren't cached @app.after_request def after_request(response): response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate" response.headers["Expires"] = 0 response.headers["Pragma"] = "no-cache" return response # Configure session to use filesystem (instead of signed cookies) app.config["SESSION_FILE_DIR"] = mkdtemp() app.config["SESSION_PERMANENT"] = False app.config["SESSION_TYPE"] = "filesystem"
What I don't understand is, in what circumstances would I need to disable caching of responses or make sure that sessions are stored on the local filesystem rather than in cookies? Especially in light of my final project, where I'd like to try to create a Web application using Flask.
Thanks a lot in advance!