[Catalyst] (Beginner) Plugins
Alejandro Imass
alejandro.imass at gmail.com
Tue Oct 24 16:03:46 GMT 2006
On 10/24/06, Yuval Kogman <nothingmuch at woobling.org> wrote:
>
> Ouch, what an insane client...
>
> I hope you're charging them $$$ ;-)
Not really. But they gave me the opportunity to use whatever I wanted so it
was perfect for my first Catalyst project. You now must think that it is I
who is insane!
>
> Use ImageMagic/Imager/GD or whatever to dump out a scalar, and then
> put that in $c->response->body, and set the content type
> appropriately, in something like
Yes, I was thinking along these lines. I had done something similar with
MapServer several years ago, but used random number image files.
> sub images : Local {
> my ( $self, $c, $image ) =3D @_;
[...]
# make sure to set the caching control headers, like
> # expires, cache-control, last-modified, etc
> }
Thanks for the example!
and make sure that $scaled can behave nicely with Storable.
Ok.
The reason I suggest doing this and not adjacent files is that the
> key space cardinality ( image * width * height ) is very big. If you
> only need width that's better, i guess, but there's still a
> potential to easily have several hundred versions of a single image.
Yeah well. In either case I have to generate the image, so unless, the
images are re-used
it makes no sense to store them on disk. If the image name had the
dimentions I could check if that particular image was already generated, but
it looks like too much trouble.
I think I will use AJAX to request the generation of the image. Besides, all
this trouble is _only_ for the main page news image and a few other places.
The site itself is actually quite simple.
When I finish this site I will make the code available so you can shoot at
it :-D
Using one of the Cache modules on the CPAN you can constrain the
> cache to say 200MB and still get decent performance.
>
> I hope this helps
>
>
> There are two more categories of plugins - ones that act on the web
> specific data structures (e.g. C::P::Browser, C::P::Session), and
[...]
controller just using caching services, and the configuration
> providing all the know-how for choosing the right cache, etc.
>
> It doesn't sound like any of these scenarios coincide with yours.
Thanks!
--
> Yuval Kogman <nothingmuch at woobling.org>
> http://nothingmuch.woobling.org 0xEBD27418
>
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jules.scsys.co.uk/pipermail/catalyst/attachments/20061024/80721=
26c/attachment.htm
More information about the Catalyst
mailing list