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

Bruce Elrick belrick@home.com
Sun, 14 Nov 1999 09:40:30 -0700


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?
> 

I use <dtml-var "PARENTS[-1].Graphics.logo_png"> etc. It causes the graphics
to alwqays have the same URL and thus be cachable.  Note this is one of those
cases where it is best not to have periods in the object name.

Cheers...
Bruce
--
Bruce Elrick, Ph.D.                       Saltus Technology Consulting Group
Personal: belrick@home.com                          IBM Certified Specialist
Business: belrick@saltus.ab.ca          ADSM, AIX Support, RS/6000 SP, HACMP