Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Caching images from RDBMS

by perrin (Chancellor)
on Aug 08, 2002 at 12:03 UTC ( #188566=note: print w/replies, xml ) Need Help??

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;


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

        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


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://188566]
[1nickt]: think that might be a winner, stevieb

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2017-03-26 18:28 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (315 votes). Check out past polls.