diff --git a/lib/WebGUI/Cache.pm b/lib/WebGUI/Cache.pm index 7e32aad0b..892f46c62 100644 --- a/lib/WebGUI/Cache.pm +++ b/lib/WebGUI/Cache.pm @@ -179,7 +179,7 @@ sub set { =head2 setByHTTP ( url [, ttl ] ) -Retrieves a document via HTTP and stores it in the cache. +Retrieves a document via HTTP and stores it in the cache and returns the content as a string. =over @@ -204,6 +204,7 @@ sub setByHTTP { my $request = new HTTP::Request (GET => $_[1], $header); my $response = $userAgent->request($request); $_[0]->set($response->content,$_[2]); + return $response->content; } diff --git a/lib/WebGUI/Operation/Statistics.pm b/lib/WebGUI/Operation/Statistics.pm index 06c484e17..3f4c3e846 100644 --- a/lib/WebGUI/Operation/Statistics.pm +++ b/lib/WebGUI/Operation/Statistics.pm @@ -158,8 +158,7 @@ sub www_viewStatistics { my $cache = WebGUI::Cache->new($url,"URL"); my $version = $cache->get; if (not defined $version) { - $cache->setByHTTP($url,43200); - $version = $cache->get; + $version = $cache->setByHTTP($url,43200); } chomp $version; $output .= helpIcon(12);