Cache (or not)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Greetings One and All

Consider this ....

A store of image files in original format as delivered by the photographer  
- means large

A process that reads the the file, resizes for display - perhaps as a  
thumbnail - before presenting it to the visitor.

Ok, so far so good.

Last time I built one of these I made a caching process.  The request  
first checks to see if there's a stored, cached version of the image  
file.  If not, then it creates one.

Any thoughts on whether it's worth the effort?  I mean there is obviously  
dev effort in building maintaining the cache but is the benefit in reduced  
server load real or imaginary?  In other words, is it worth worth  
providing this functionality?

William Tasso

** Business as usual

Re: Cache (or not)

William Tasso wrote:
Quoted text here. Click to load it

Depending upon your application, wouldn't a copy of Coldmine do what you
want? This is a graphics album in OpenSource.

The photographer uploads a photo, which the software thumbnails. The
album can be public or private.

Clicking on a thumbnail allows a larger photo to be displayed.

Just a thought to keep you from redesigning the world if another idea
might work.

Re: Cache (or not)

William Tasso wrote:
Quoted text here. Click to load it
Sorry, I meant COPPERMINE /

Re: Cache (or not)

Writing in news:alt.www.webmaster
 From the safety of the EarthLink Inc. -- cafeteria

Quoted text here. Click to load it

Thanks - a quick look at "03: Endless Features!" reveals that this poject  
addresses a different need.  However, many thanks for the reminder.

William Tasso

** Business as usual

Re: Cache (or not)

William Tasso wrote:

Quoted text here. Click to load it

I would tend to say yes, but it depends on a number of factors, not
limited to how many photos there are, how frequently they are accessed,
and how restricted you are with regards to disk space on the server.

Toby A Inkster BSc (Hons) ARCS
Contact Me  ~

Re: Cache (or not)

William Tasso wrote :
Quoted text here. Click to load it

I say yes!.  I had a similar question I was asking myself in a recent
site I built.  I found that it really did make a huge difference in
performance.  The benefit is most certainly real.  Do it.  I would
consider building thumbnails and displayable images upon upload of
original image.

You may need to consider other resources like server disk space and
database space allocated...

but I say - do it!

a beef jerky web site :
not a beef jerky web site :
if the oil light is on, dont think it will just go away

Re: Cache (or not)

And lo, William Tasso didst speak in alt.www.webmaster:

Quoted text here. Click to load it

Disk space is cheap.  CPU cycles and delivery speed generally aren't,  
especially if you're on a shared server.  You should cache whenever  
possible, as long as it's at all reasonable.

For instance, in the search engine I'm building, I cache search results.  
So while your first search might take half a second to process, if you  
page forward or backward through the results, it takes less than three  
hundredths of a second for each request afterwards.

However, there's a limit to the feasibility of such a system, because the  
number of terms for which results can be cached is almost infinite.  So I  
counter this by assigning a cache table-size limit and a time to each set  
of cached results, and update that time whenever it is searched for  
again.  If the cache table is larger than the limit, the script goes  
through the table deleting the oldest cached results until it is under the  
limit again.

A thumbnail cache is different because there is only one item to cache per  
uploaded image.  Because there are a finite set of cacheable items, it  
makes sense to cache all of them since it's pretty easy to estimate how  
much additional disk space you'll end up needing.


The technical axiom that nothing is impossible sinisterly implies the  
pitfall corollory that nothing is ridiculous.
- - Orca Knowledgebase: Completely CSS styleable  
Knowledgebase/FAQ system

Re: Cache (or not)

Writing in news:alt.www.webmaster
 From the safety of the Chaos cafeteria

Quoted text here. Click to load it

Thank you for your considered opinions gentlemen.  Caching has been  
enabled; and yes, it does make a noticable difference to performance  
especially when processing increadibly large originals.

Having the script tidy after itself is a good thought - haven't thought  
through plans for implenting a tidy up yet.

Once again, thanks for your thoughts.
William Tasso

** Business as usual

Site Timeline