Mail Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ApacheGallery] Patch to replace inline C code with native Perl



On Wed, Mar 12, 2003 at 10:00:28AM -0800, Jon McClintock wrote:
> On Wed, Mar 12, 2003 at 06:49:33PM +0100, Thomas Kj?r wrote:
> > On Wed, Mar 12, 2003 at 09:44:03AM -0800, Jon McClintock wrote:
> > > > Yes, the reason why we initially put it in the index page was that it
> > > > only has to be done once. What you really are requesting from the
> > > > page is the already scaled image and not something that gets scaled on
> > > > the fly. And because of the way we use templates it's not really 
> > > > possible to spit out the HTML as soon as the image is generated.
> > > 
> > > This doesn't make sense. The browser client makes seperate requests for
> > > the HTML and the images. You can generate the HTML without having
> > > generated all of the images. Why not save the image resize step until
> > > the client requests the image?
> > 
> > One reason could be that the script still would have to access all
> > images to get the height/width parameters into the html.
> 
> Not really. All of the image/thumbnail sizes are calculated from the size 
> of the original image, which is obtained using Image::Size. After all,
> it has to know the size of the resized image to be able to call the
> resizeimage() routine.

The real problem is that if you have a lot of pictures in the directory
and it tries to load 5-10 pictures at a time over different connections
you'll have 10 times the load over generating them just once when the
index is requested.

-- 
  Thomas Eibner <http://thomas.eibner.dk/> DnsZone <http://dnszone.org/>
  mod_pointer <http://stderr.net/mod_pointer> <http://photos.eibner.dk/>
  !(C)<http://copywrong.dk/>                  <http://apachegallery.dk/>
          Putting the HEST in .COM <http://www.hestdesign.com/>