> If the image name had the dimensions I could check if that particular
> image was already generated, but it looks like too much trouble.

That's what this code does:

    my $key = join(":", $width, $height, $image );
    my $scaled = $cache->get($key);
    unless ( defined $scaled ) { ... $scaled = scale_the_image() ... }

If the image was in cache, the unless(){} block is skipped, and the
cached version is stored.  If the image wasn't in cache, it's scaled and
then stored in the cache.  The $c->cache handles expiration, elimination
of duplicate entries, etc.

Regards,
Jonathan Rockway

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to