Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

home: Add rel=dns-prefetch to Gravatar and any Zulip avatar host.

Alex Vandiver854ec40defd7
diff --git a/templates/zerver/app/index.html b/templates/zerver/app/index.html
index b8f461d581b..32c9d3a8855 100644
--- a/templates/zerver/app/index.html
+++ b/templates/zerver/app/index.html
@@ -8,6 +8,10 @@
{% endblock %}
{% block customhead %}
+{% if enable_gravatar %}<link rel="dns-prefetch" href="https://secure.gravatar.com" />
+{% endif -%}
+{% if s3_avatar_public_url_prefix %}<link rel="dns-prefetch" href="{{ s3_avatar_public_url_prefix }}" />
+{% endif -%}
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="{{ static('images/logo/apple-touch-icon-precomposed.png') }}" rel="apple-touch-icon-precomposed" />
<style>
diff --git a/zerver/views/home.py b/zerver/views/home.py
index 043776559a2..1fa4751ccd5 100644
--- a/zerver/views/home.py
+++ b/zerver/views/home.py
@@ -241,6 +241,10 @@ def home_real(request: HttpRequest) -> HttpResponse:
"page_params": page_params,
"csp_nonce": csp_nonce,
"color_scheme": user_permission_info.color_scheme,
+ "enable_gravatar": settings.ENABLE_GRAVATAR,
+ "s3_avatar_public_url_prefix": settings.S3_AVATAR_PUBLIC_URL_PREFIX
+ if settings.LOCAL_UPLOADS_DIR is None
+ else "",
},
)
patch_cache_control(response, no_cache=True, no_store=True, must_revalidate=True)