--- loncom/lonnet/perl/lonnet.pm 2003/09/19 16:53:35 1.417 +++ loncom/lonnet/perl/lonnet.pm 2003/09/19 18:20:35 1.419 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.417 2003/09/19 16:53:35 albertel Exp $ +# $Id: lonnet.pm,v 1.419 2003/09/19 18:20:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3295,14 +3295,6 @@ sub condval { return $result; } -# ---------------------------------------------------- Devalidate courseresdata - -sub devalidatecourseresdata { - my ($coursenum,$coursedomain)=@_; - my $hashid=$coursenum.':'.$coursedomain; - delete $courseresdatacache{$hashid.'.time'}; -} - # --------------------------------------------------- Course Resourcedata Query sub courseresdata { @@ -3814,13 +3806,8 @@ sub gettitle { unless ($urlsymb) { $urlsymb=$ENV{'request.filename'}; } return &metadata($urlsymb,'title'); } - if ($titlecache{$symb}) { - if (time < ($titlecache{$symb}[1] + 600)) { - return $titlecache{$symb}[0]; - } else { - delete($titlecache{$symb}); - } - } + my ($result,$cached)=&is_cached(\%titlecache,$symb,600); + if (defined($cached)) { return $result; } my ($map,$resid,$url)=&decode_symb($symb); my $title=''; my %bighash; @@ -3832,8 +3819,7 @@ sub gettitle { } $title=~s/\&colon\;/\:/gs; if ($title) { - $titlecache{$symb}=[$title,time]; - return $title; + return &do_cache(\%titlecache,$symb,$title); } else { return &metadata($urlsymb,'title'); }