From 1793ac3111ce3288de96f6296476b2bf820d25de Mon Sep 17 00:00:00 2001 From: projectedanx <238904666+projectedanx@users.noreply.github.com> Date: Sat, 6 Jun 2026 16:18:48 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20cache=20favicon=20url=20per=20site?= =?UTF-8?q?=20in=20yourls=5Fget=5Ffavicon=5Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- includes/functions-infos.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/functions-infos.php b/includes/functions-infos.php index d28a3d687..3a2241f40 100644 --- a/includes/functions-infos.php +++ b/includes/functions-infos.php @@ -294,7 +294,11 @@ function yourls_get_domain($url, $include_scheme = false) { * @return string The favicon URL. */ function yourls_get_favicon_url($url) { - return yourls_match_current_protocol( '//www.google.com/s2/favicons?domain=' . yourls_get_domain( $url, false ) ); + static $cache = array(); + if ( ! isset( $cache[$url] ) ) { + $cache[$url] = yourls_match_current_protocol( '//www.google.com/s2/favicons?domain=' . yourls_get_domain( $url, false ) ); + } + return $cache[$url]; } /**