Questions about good tpl design for Static Caching

Author Message

Massimiliano Bariola

Wednesday 22 February 2006 5:36:39 am

Hi,

I am looking forward to activate static caching on a high-traffic website, and had some questions for those who are experienced in its use so to avoid problems later.

All of this revolves around the use of navigator/google.tpl which caused me some cache-related problems when I used it on earlier projects. maybe these can be avoided with a cleverer design springing up from your suggestions :-)

I have some override templates for specific folders which list their content as a formatted list. for big amounts of items, this list is paged - so google.tpl serves just this purpose.

the google.tpl include is placed at the end of the "full" override template for the folder.

let's suppose I have 2 of these list folders accessible at /foo/list1 and /foo/list2.

When I have viewcaching, contentcaching, templatecompile and templatecaching on, and I access /foo/list1, google.tpl generates links like /foo/list1/(offset)/10, /foo/list1/(offset)/20, etc. so far, so good!

however, when I access /foo/list2, google.tpl will generate links like /foo/list1/(offset)/10 and so on. thus using the first accessed node , list1 , as a base. eek!.

I don't know whether this is connected to ViewCaching or to TemplateCompile or TemplateCaching, but let's say I worked around this, by using cache-blocks and leaving the google.tpl out of them.

So, now I have a site which is working with "regular" caching, at the expense of the need to use some tricks (disable cache, enable cache for all tpl save the google.tpl and so )

Now I want to use static cache. by definition, static cache generator renders all the full templates of all content nodes. Enter those folders with big amounts of items and let's assume that the HTML content is correctly generated for all nodes.

The problem here is, there are some classes which do not have a full.tpl of their own - but they are meant to be displayed into other templates. my case is an image gallery with some navigators.

from a functional and design point of view, it makes sense that the navigator logic and the thumbnails be visible in the template of the gallery node (since the gallery/folder node "knows" its children, while the single image is displayed in a space of this template. But if static cache works as I think it does, I have to turn this structure backwards, and have the override template for the single image-node contain the navigator, and have the override folder for the gallery folder simply not be available for direct view, but redirect somehow to one of it's children node images.

I hope I have been clear - so, can anyone share their experience on this? and am I right in thinking so, or am I overlooking something / wrong on something?

thanks for your contributions and thoughts,

Massimiliano

Gabriel Ambuehl

Thursday 23 February 2006 6:41:19 am

This issue is pretty much a non issue when you know how static cache works [1]. It does, in fact (took me some messing with the code as per usual, but I believe in the end it boils down to this) SPIDER the site like any other spider would see it. So it sees exactly what YOU see on the site when you access it (as anonymous obviously).

If currently the links work ok, they very well should keep on doing so.

[1] If that is not correct, please excuse, it was many months ago that I played with this feature.

Visit http://triligon.org

Massimiliano Bariola

Thursday 23 February 2006 6:45:11 am

Thanks Buz, that actually seems a more sensible way of working, and it gets rid of a lot of problems! ;-)

if this is the case, I'll knock my bosses's socks off when I'll turn on that baby.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.