From ea6b0baf7a349c4ca41b4bf41bed3c7764f414cf Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 21 Apr 2015 16:48:32 +0100 Subject: [PATCH] Do not store redirects to the same url. --- utils/redirector.pl.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/redirector.pl.in b/utils/redirector.pl.in index b33886824..232921d5b 100755 --- a/utils/redirector.pl.in +++ b/utils/redirector.pl.in @@ -193,10 +193,13 @@ sub memcached_check_url { # Write url to memcached key sub memcached_cache_url { my ( $url, $url_real ) = @_; + + if ($url ne $url_real) { + my $context = Digest->new("SHA-256"); - my $context = Digest->new("SHA-256"); - - $memd->set(unpack("H*", ($context->hash($url))), $url_real, $cfg{cache_expire}); + $memd->set(unpack("H*", ($context->hash($url))), $url_real, + $cfg{cache_expire}); + } } # POE http client callback -- 2.39.5