giulienk has asked for the wisdom of the Perl Monks concerning the following question:
This is working fine except for caching. Browsers keeps on asking conditional GETs sending If-Modified-Since fields.use strict; use lib '/path/to/my/lib/'; use MyDBI; #export $dbh use CGI qw(header path_info); my ($id, $image) = path_info() =~ m{(\d+)_((?:image|thumb|mini)[1-3])(_.+)?\.jpe?g$} +i; exit unless $id and $image; my ($file) = $dbh->selectrow_array("SELECT $image from offerte WHERE +id=$id"); exit unless $file; print header(-type => 'image/jpeg', -Content_length => length $file), +$file;
$|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Caching images from RDBMS
by tadman (Prior) on Aug 08, 2002 at 10:41 UTC | |
by giulienk (Curate) on Aug 08, 2002 at 10:54 UTC | |
|
Re: Caching images from RDBMS
by perrin (Chancellor) on Aug 08, 2002 at 12:03 UTC | |
by giulienk (Curate) on Aug 08, 2002 at 12:25 UTC | |
by waswas-fng (Curate) on Aug 08, 2002 at 14:47 UTC | |
by giulienk (Curate) on Aug 08, 2002 at 16:26 UTC |