[Zope] Zope and remote caches.

jiva@devware.com jiva@devware.com
Wed, 1 Mar 2000 22:04:36 -0700


This is highly cool, is there anyplace that this, and other similar
methods are documented besides the code itself?

On Wed, Mar 01, 2000 at 07:49:48AM -0500, Martijn Pieters wrote:
> From: jiva@devware.com [mailto:jiva@devware.com]
> > So, if I am grokking the whole zope thang properly here, then
> > theoretically, when I imbed objects within my zope documents, I
> > shouldn't hardcode in specific urls to them.  Instead, I should treat
> > them almost as if they are always in the current directory, even if
> > they are a couple of folders up.  This way, if I want to override some
> > behavior in the future, I just copy the object down into the current
> > folder and edit it.  I notice however, that if I do this, it plays
> > hell with browser caching because the browser winds up pulling things
> > from different places all the time even if it's actually winding up
> > pulling the same document down.  How do other people deal with this?
> 
> Use the absolute_url() method on the objects. 
> 
> That way, your generated HTML will contain absolute URLs to the objects,
> that are the same across different Folders in your site even when the
> object is acquired from elsewhere. Overriding as you described will
> still work the same, the URLs will reflect the change accordingly.
> 
> Syntax variations (as always from the top of my head, not tested, YMMV):
> 
>   <dtml-var "object.absolute_url()">
>   <dtml-var object url>
>   &dtml.url-object;
> 
> The last notation is especially useful in HTML tag attributes, as it
> won't break WYSIWYG HTML editors:
> 
>   <a href="&dtml.url-object;">Go to object</a>
> 

-- 
COBOL:
	Completely Over and Beyond reason Or Logic.