Skip to content

Commit

Permalink
implementing cache-control headers
Browse files Browse the repository at this point in the history
  • Loading branch information
maceto committed Jun 11, 2024
1 parent b8f84da commit df3bbd1
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 7 deletions.
6 changes: 5 additions & 1 deletion functions/adoption/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ def dispatcher(request):
if request.method == "OPTIONS":
return respond_cors()

headers = {"Access-Control-Allow-Origin": "*"}
headers = {
"Access-Control-Allow-Origin": "*",
"cache-control": "public, max-age=21600"
}

args = request.args.to_dict()

validator = Validator(params=args)
Expand Down
6 changes: 5 additions & 1 deletion functions/categories/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ def dispatcher(request):

return ("", 204, headers)

headers = {"Access-Control-Allow-Origin": "*"}
headers = {
"Access-Control-Allow-Origin": "*",
"cache-control": "public, max-age=21600"
}

args = request.args.to_dict()

validator = Validator(params=args)
Expand Down
6 changes: 5 additions & 1 deletion functions/cwvtech/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def dispatcher(request):
return ("", 204, headers)

# Set CORS headers for the main request
headers = {"Access-Control-Allow-Origin": "*"}
headers = {
"Access-Control-Allow-Origin": "*",
"cache-control": "public, max-age=21600"
}

args = request.args.to_dict()

validator = Validator(params=args)
Expand Down
5 changes: 4 additions & 1 deletion functions/geos/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def dispatcher(request):
return ("", 204, headers)

# Set CORS headers for the main request
headers = {"Access-Control-Allow-Origin": "*"}
headers = {
"Access-Control-Allow-Origin": "*",
"cache-control": "public, max-age=21600"
}

response = Result(result=COUNTRIES)

Expand Down
6 changes: 5 additions & 1 deletion functions/lighthouse/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def dispatcher(request):
return ("", 204, headers)

# Set CORS headers for the main request
headers = {"Access-Control-Allow-Origin": "*"}
headers = {
"Access-Control-Allow-Origin": "*",
"cache-control": "public, max-age=21600"
}

args = request.args.to_dict()

validator = Validator(params=args)
Expand Down
6 changes: 5 additions & 1 deletion functions/page-weight/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def dispatcher(request):
return ("", 204, headers)

# Set CORS headers for the main request
headers = {"Access-Control-Allow-Origin": "*"}
headers = {
"Access-Control-Allow-Origin": "*",
"cache-control": "public, max-age=21600"
}

args = request.args.to_dict()

validator = Validator(params=args)
Expand Down
5 changes: 4 additions & 1 deletion functions/ranks/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def dispatcher(request):
return ("", 204, headers)

# Set CORS headers for the main request
headers = {"Access-Control-Allow-Origin": "*"}
headers = {
"Access-Control-Allow-Origin": "*",
"cache-control": "public, max-age=21600"
}

response = Result(result=RANKS)

Expand Down

0 comments on commit df3bbd1

Please sign in to comment.