On 09/16/2009 01:02 PM, Igor Chudov wrote:

I actually do cache generated pictures, I store them in a database table
called 'bincache'. This way I do not have to compute and draw every
image on the fly. If I have a picture in bincache, I serve it, and if I
do not, I generate it and save it. That saves some CPU, but makes mysql
work harder.

Then don't put it in your database. A cache is not a permanent store and it's usage patterns will be different than a database. I'd either use a real cache like memcached or have your proxies cache them. In addition to that you can send the appropriate HTTP cache headers so that browsers themselves will never request that image again. Make the client machine do the caching.

--
Michael Peters
Plus Three, LP

Reply via email to