[Seaside] Using image tags in Seaside

Nevin Pratt nevin at bountifulbaby.com
Thu Sep 9 16:52:15 CEST 2004


Avi Bryant wrote:

>
> On Sep 8, 2004, at 5:56 PM, Andreas Nilsson wrote:
>
>> I'm trying to get seaside to show images on a page, but I don't 
>> understand where to put the files.
>> Found a FAQ on the web that said something about DocumentRoot in the 
>> application config, but I can't find any setting named DocumentRoot.
>
>
> Wow.  That FAQ is ancient - in fact, most of the content on that wiki 
> is (note that I don't, AFAIK, link to it from anywhere anymore).
>
> Anyway, there are basically two options:
>
> - have the images hosted externally to Seaside, and use image tags 
> with external URLs:
>     html image: 'http://imagehost.com/myimage.jpg' altText: 'My Image'
>
> - suck the image data into your (Squeak) image, and serve it directly 
> from Seaside:
>     html imageWithForm: (MyImages at: #someImage)
>
> I prefer the second, from a deployment point of view, because you end 
> up with just one .image file to copy around.  It's also great for 
> dynamically generated images (use PlotMorph to generate live charts, 
> for example).  But having something like apache serving static images 
> can be a performance win.
>
> Avi
>

Andreas,

Not-withstanding Avi's preference, which sounds just fine, we 
never-the-less do the first.  My main reason for doing the first is 
because images tend to be high bandwidth resource hogs, and I prefer to 
keep such bandwidth hogs off of our main network, and moved over to a 
different network that is optimized for raw static image serving (served 
by Apache, and located elsewhere).  You can "buy" a site from pretty 
much anywhere that will serve your images for you, and the cost is 
reasonably cheap.  And you can upgrade such a site as necessary to 
reflect your bandwidth needs.

And, there certainly is no reason why you can't intermix both schemes, 
depending upon your particular needs.

Nevin




More information about the Seaside mailing list