Help for this page

Select Code to Download


  1. or download this
    Overview:
      if cache's modification time is less than 60 seconds old, or less th
    +an 120 seconds old when it's busy being updated {
        load cached hash
      else
        load information via API and save hash to speed up subsequent look
    + ups
    
  2. or download this
    my $cache_ttl = 60;
    my $cachefile = '/tmp/mtapi.'.$router.'.cache';
    ...
      close LOCK;
      unlink $lockfile;
    }