Skip to content

Commit df3bbd1

Browse files
committed
implementing cache-control headers
1 parent b8f84da commit df3bbd1

File tree

7 files changed

+33
-7
lines changed

7 files changed

+33
-7
lines changed

functions/adoption/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ def dispatcher(request):
1010
if request.method == "OPTIONS":
1111
return respond_cors()
1212

13-
headers = {"Access-Control-Allow-Origin": "*"}
13+
headers = {
14+
"Access-Control-Allow-Origin": "*",
15+
"cache-control": "public, max-age=21600"
16+
}
17+
1418
args = request.args.to_dict()
1519

1620
validator = Validator(params=args)

functions/categories/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ def dispatcher(request):
2121

2222
return ("", 204, headers)
2323

24-
headers = {"Access-Control-Allow-Origin": "*"}
24+
headers = {
25+
"Access-Control-Allow-Origin": "*",
26+
"cache-control": "public, max-age=21600"
27+
}
28+
2529
args = request.args.to_dict()
2630

2731
validator = Validator(params=args)

functions/cwvtech/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ def dispatcher(request):
2222
return ("", 204, headers)
2323

2424
# Set CORS headers for the main request
25-
headers = {"Access-Control-Allow-Origin": "*"}
25+
headers = {
26+
"Access-Control-Allow-Origin": "*",
27+
"cache-control": "public, max-age=21600"
28+
}
29+
2630
args = request.args.to_dict()
2731

2832
validator = Validator(params=args)

functions/geos/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ def dispatcher(request):
2323
return ("", 204, headers)
2424

2525
# Set CORS headers for the main request
26-
headers = {"Access-Control-Allow-Origin": "*"}
26+
headers = {
27+
"Access-Control-Allow-Origin": "*",
28+
"cache-control": "public, max-age=21600"
29+
}
2730

2831
response = Result(result=COUNTRIES)
2932

functions/lighthouse/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ def dispatcher(request):
2222
return ("", 204, headers)
2323

2424
# Set CORS headers for the main request
25-
headers = {"Access-Control-Allow-Origin": "*"}
25+
headers = {
26+
"Access-Control-Allow-Origin": "*",
27+
"cache-control": "public, max-age=21600"
28+
}
29+
2630
args = request.args.to_dict()
2731

2832
validator = Validator(params=args)

functions/page-weight/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ def dispatcher(request):
2222
return ("", 204, headers)
2323

2424
# Set CORS headers for the main request
25-
headers = {"Access-Control-Allow-Origin": "*"}
25+
headers = {
26+
"Access-Control-Allow-Origin": "*",
27+
"cache-control": "public, max-age=21600"
28+
}
29+
2630
args = request.args.to_dict()
2731

2832
validator = Validator(params=args)

functions/ranks/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ def dispatcher(request):
2323
return ("", 204, headers)
2424

2525
# Set CORS headers for the main request
26-
headers = {"Access-Control-Allow-Origin": "*"}
26+
headers = {
27+
"Access-Control-Allow-Origin": "*",
28+
"cache-control": "public, max-age=21600"
29+
}
2730

2831
response = Result(result=RANKS)
2932

0 commit comments

Comments
 (0)