Skip to content

Commit 8d62919

Browse files
authored
Merge pull request #22 from HTTPArchive/development
New version with cache conrol
2 parents fde156b + e68fd39 commit 8d62919

File tree

8 files changed

+38
-9
lines changed

8 files changed

+38
-9
lines changed

functions/adoption/main.py

Lines changed: 6 additions & 2 deletions
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)
@@ -22,4 +26,4 @@ def dispatcher(request):
2226

2327
response = list_data(result.result)
2428

25-
return output(response, headers)
29+
return output(response, headers)

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

functions/technologies/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ 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+
}
2629
args = request.args.to_dict()
2730

2831
validator = Validator(params=args)

0 commit comments

Comments
 (0)