[ZDP] Images on ZDP:8080 use relative paths

Martijn Pieters mj@digicool.com
Mon, 17 Jan 2000 04:31:05 -0500


> -----Original Message-----
> From: Tom Deprez [mailto:tom.deprez@village.uunet.be]
> Hi Martijn,
> 
> How are you doing? Had a nice rest?

I am very fine, thank you =) I hope you are too, with your work and all?

> 
> Thanks for pointing this out! I just adjusted this and it is really a
> speed-up!
> 
> However, I don't understand it very well, why this happens. I 
> believe other
> people already explained these things in other ways (I think 
> Rik did in his
> drafts), but it looks like I still don't catch the idea...
> 
> Can you tell me in another way how this is so important to 
> use /ZDP/images?
> Because /ZDP/images is still a relative path, isn't it?

Not to the server it is not. Let me illustrate what happens:

When in /ZDP/News/, your browser is instructed to load the images from
the images/ subdirectory, which is relative to the current page. It
reconstructs the path to  http://zdp.zope.org/ZDP/News/images/. This
works on Zope, because that Folder is available via acquisition. 

If you are in /ZDP/Projects/, following the same rules the browser will
get the images from http://zdp.zope.org/ZDP/Projects/images/. Again,
this works through acquisition. 

A browser has never heard of acquisition however, and sees images from
one URL as different from another, and fetches what to the server are
the same images anew when in a different part of the ZDP website.

If you specify the images as being from /ZDP/images though, the path is
only relative to the server (because it starts with a slash), and
wherever you are in the ZDP website, the browser reconstructs the URL to
read http://zdp.zope.org/ZDP/images/. The first time it comes across
these images, it will fetch them from the server, and for the rest of
the ZDP site, it will recognize this for the same images (because they
have the same URL), and use the cached versions instead, speeding up the
site tremendously.

Hope this helps you understand these issues, Tom.

-- 
Martijn Pieters, Software Engineer 
| Digital Creations http://www.digicool.com 
| Creators of Zope      http://www.zope.org 
| mailto:mj@digicool.com       ICQ: 4532236
| PGP:
http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 
-------------------------------------------