# Caching + gallery\_behavior

**URL:** <https://www.ruby-forum.com/t/caching-gallery-behavior/69955>\
**Category:** Radiant CMS\
**Created:** [September 25, 2006, 8:32pm UTC](https://www.ruby-forum.com/t/caching-gallery-behavior/69955 "2006-09-25T20:32:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_Coppedge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@J\_Coppedge](https://www.ruby-forum.com/u/J_Coppedge)\
**Post date:** [September 25, 2006, 8:32pm UTC](https://www.ruby-forum.com/t/caching-gallery-behavior/69955/1 "2006-09-25T20:32:30Z")

</div>

I’ve been using the gallery\_behavior for a simple directory/file based  
gallery. Works well - but have a couple of questions that others may  
have  
already experienced…

1. Is there a way to control the image caching separately from the rest  
of  
the site? The default cache is 5 minutes and is quite short for an  
image  
gallery that has to generate the thumbnails on the fly. Just causes  
overhead and slowdowns. The temporary fix I have in place is to do  
longer  
sitewide cache - however not ideal for other parts of the site.

2. The auto resized images and thumbnails that are generated seem larger  
the  
expected, is there a quality switch to reduce the quality when resizing?  
A  
80x60 thumbnail shouldn’t be 20 KB, should it? Is the option to just  
change  
the thumbnails to GIFs versus PNG?

---

<div class="post-metadata">

**Author:** ![J\_Coppedge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@J\_Coppedge](https://www.ruby-forum.com/u/J_Coppedge)\
**Post date:** [September 26, 2006, 6:07am UTC](https://www.ruby-forum.com/t/caching-gallery-behavior/69955/2 "2006-09-26T06:07:28Z")

</div>

Hi,

On 25-Sep-2006 13:30 -0500, J Coppedge was heard to say:

> 1. Is there a way to control the image caching separately from the rest of  
> the site? The default cache is 5 minutes and is quite short for an image  
> gallery that has to generate the thumbnails on the fly. Just causes  
> overhead and slowdowns. The temporary fix I have in place is to do longer  
> sitewide cache - however not ideal for other parts of the site.

I don’t think there is currently a way to individually change the cache  
timeout for certain requests, but I don’t see it to be very hard to  
implement in one of the future versions of either Radiant or the  
gallery\_plugin.

> 1. The auto resized images and thumbnails that are generated seem larger the  
> expected, is there a quality switch to reduce the quality when resizing? A  
> 80x60 thumbnail shouldn’t be 20 KB, should it? Is the option to just change  
> the thumbnails to GIFs versus PNG?

PNG might have been a bad choice and I should probably provide an option  
for JPEG and/or GIF. Also for the larger images JPEG is certainly a  
better  
choice since right now images seem to take forever to load.

I might be able to add those features sometime this week or over the  
weekend.

Cheers,  
Oliver
