
ok, real simple docs here.  sorry.

these scripts are what i use to permaently cache downloads from microsoft
(including windows update).

you'll need squid, apache and perl.  and you'll need to know how to
configure squid and apache.

you'll also need wget and the perl Date::Parse module (part of the TimeDate
package).  download from http://search.cpan.org/~GBARR/TimeDate, install
instructions at http://www.cpan.org/modules/INSTALL.html.

there's three scripts

	redir.pl	redirector script for squid
	download	called by redir.pl
	check_store	nightly cron job to stop stale and duplicate entries

the flow of redir.pl is ..

  if the request is for a microsoft cab/exe
    if the file doesn't exist in the store
      spawn the download script to download into the store
    else
      rewrite the url to redirect to the store
    endif
  endif

to install

  1. create a directory under your apache's htdocs area, and then a directory
     called "store" under that
       i use
         /usr/local/apache/htdocs/cache
         /usr/local/apache/htdocs/cache/store

  2. modify paths in redir.pl
       $cache_path = path to the store
       $cache_url  = internal url to the store
       $downloader = full path to the download script
     modify $cache_path in download
     modify $cache_path in check_store

  3. configure squid to use redir.pl

  4. set up a cron job to run check_store nightly

the download script will need permissions to create a file called "log"
(it will run as the same user that runs squid).  it also needs permissions
to write to the store directory.


these instructions probably aren't very clear, but i'm half asleep.  if you
need help, byron@glob.com.au


byron


