-----Original Message----- From: Lennart Regebro [mailto:lennart@regebro.nu] Sent: Tuesday, January 29, 2002 10:50 AM To: zope@zope.org Subject: Re: [Zope] Simple (I hope) question re: images
From: "Jeffrey Robinson" <Jeffrey.Robinson@MCICoach.com>
Lennart Regebro:
When you have a relative path to the image that image doesn't get cached properly, since the webbroswer thinks /image/bla.gif is another picture than /foo/bar/image/bla.gif, while in reality they are the same.
Just out of curiosity, is this true (the caching "problem") if a "base href" is included in the document's <head>?
Uhm, how do you mean? Do you mean that you should include a base href that points to the root always, regardless of the document location? That can't be good.
In most of my documents I always have a <href base> within the <head>, such as: <base href="http://manage.anecho.mb.ca/"> In all events that I've seen the base href is prepended to any referenced link in the HTML document unless that link is preceded by http:// (I might be off on the mechanics, this is just an observation). Thus, if I have a link in my code, located anywhere on my server with a base href like shown above and the tag reads <img src="images/picture.jpg">, the browser pulls up http://manage.anecho.mb.ca/images/picture.jpg instead of looking for it relative to where the document came from. I wasn't certain that if having a base href then gives the browser a "canonical" address which it can use for caching; unlike the relative path problem that you mentioned. Jeff