http://qs321.pair.com?node_id=188566


in reply to Caching images from RDBMS

Just set an Expires header and you won't need to deal with the 304 case at all. It will be faster too.

Replies are listed 'Best First'.
Re: Re: Caching images from RDBMS
by giulienk (Curate) on Aug 08, 2002 at 12:25 UTC
    Thank you so much for the simplest, fastest and works like a charm solution ;)

    Here's the modified line that makes the trick:

    print header(-type => 'image/jpeg', -Content_length => length $file, -expires => '+30d', ), $file;


    $|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g

      +30d? If your images are that static, why store them in the db? Just curious… =)

      -Waswas
        You should have read the whole thread: if the image change the URL by which it's called will change. See Re: Re: Caching images from RDBMS


        $|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g