Skip to content

Commit 912c1d4

Browse files
authored
perf: Add flag in Python to reduce bandwith usage (#154)
1 parent b275c75 commit 912c1d4

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

api/index.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def render():
7575
border_radius=border_radius,
7676
rtl=is_rtl(lang),
7777
rtl_title=is_rtl_title("".join(title_lines)),
78+
reduced_bandwidth=True,
7879
),
7980
status=200,
8081
mimetype="image/svg+xml",
@@ -85,7 +86,13 @@ def render():
8586
status = getattr(e, "status", 500)
8687
thumbnail = data_uri_from_file("./api/templates/resources/error.jpg")
8788
return Response(
88-
response=render_template("error.svg", message=str(e), code=status, thumbnail=thumbnail),
89+
response=render_template(
90+
"error.svg",
91+
message=str(e),
92+
code=status,
93+
thumbnail=thumbnail,
94+
reduced_bandwidth=True,
95+
),
8996
status=status,
9097
mimetype="image/svg+xml",
9198
)

api/templates/error.svg

Lines changed: 3 additions & 1 deletion
Loading

api/templates/main.svg

Lines changed: 3 additions & 1 deletion
Loading

0 commit comments

Comments
 (0)