Skip to content
Snippets Groups Projects
Commit 8b3de191 authored by Simon Künzel's avatar Simon Künzel
Browse files

Add caching for OPTIONS requests

parent 85278602
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
......@@ -4,9 +4,19 @@ if __name__ == "__main__":
import os
from flask import Flask, Config
from flask import Flask, Config, Response
app = Flask("api")
class ApiFlask(Flask):
def make_default_options_response(self) -> Response:
response = super().make_default_options_response()
# max age is in seconds
response.headers["Cache-Control"] = f"max-age={60 * 60}"
return response
app = ApiFlask("api")
config = app.config
config.from_pyfile(os.path.join(os.getcwd(), os.environ["VIDEOAG_API_CONFIG"]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment