[Zope] Acquisition isn't always bandwidth and browser-cache friendly,advice needed

Jim Washington jwashin@vt.edu
Sun, 14 Nov 1999 16:07:37 +0000


I don't know if this is the _best_ solution, but it should solve the
problem you are addressing:

Since you already have a lot of files asking for <dtml-var
"images.logo">, you could create a dtml method in your root folder
called "images.logo" that looks like the following:

<img src="<dtml-var BASE0>/images/logo">

As a bonus, you could make it link the image to your top page:

<a href="<dtml-var BASE0>/index_html"><img src="<dtml-var
BASE0>/images/logo" border="0"></a>

This way, you can still acquire images.logo, but have it call the same
URL for the image every time.

-- Jim Washington

Farzad Farid wrote:
> 
>  Hi,
> 
>  I have recently started working with Zope and I am in the process of
> building an intranet information site with it. The Acquisition paradigm
> is very powerful and interesting but I have a few remarks about its
> efficiency bandwidth-wise
> 
>  My site will mostly be composed of internal corporate documents,
> classified into folder, subfolders etc. I want a corporate logo to appear
> in top of each page. Therefore I have created a "logo" object in the top
> "images" folder, and each document uses the tag:
>                 <dtml-var "images.logo">
> 
>  Now the big trouble : suppose I have lots of documents and a deep tree of
> folder, the HTML tags I get in each page are:
>         <img src="MY_SITE/Chapter1/images/logo">
>         <img src="MY_SITE/Chapter1/Subchapter1/images/logo">
>         <img src="MY_SITE/Chapter1/Subchapter2/images/logo">
>         <img src="MY_SITE/Chapter1/Subchapter3/images/logo">
>         <img src="MY_SITE/Chapter1/Subchapter3/Subsubchapter3/imags/logo">
>         <img src="MY_SITE/Chapter2/images/logo">
>         <img src="MY_SITE/Chapter2/Subchapter1/images/logo">
>         etc.
> 
>  The same document appears on the site with dozens of different names, is
> transfered over the network dozens of times and encumbers the browser
> memory and disk cache dozens of times!
> 
>  How can this problem be solved elegantly without completely putting aside
> the acquisition process? How can I do it in this particular case with
> images?
> 
>  Thanks
> 
> --
> Farzad FARID <farzy@via.ecp.fr>
> Ingénieur Informatique Libre
> Alcôve - http://www.alcove.fr/
>