[opencms-dev] Dynamic Pages (template cache)

Ivan Biddles ivanb at scientology.net
Mon Jan 20 18:22:44 CET 2003


Hi Christian,

Thanks, but I already do that. It is not the element cache that is
causing the problem - it is this "template cache".

I created my own subclass of CmsXmlTemplate just for the purpose of
trying to solve this problem. All it has is an override of the
getCacheDirectives method in which I return "new CachDirectives(false)",
as it says to do in the manual. But the manual also says that it is for
the "element cache".

I have disabled the element cache, and added a logging line to CmsObject
that proves that the element cache reference returned from the "init"
method is always null.

However nothing seems to turn off the "template cache", which is
hard-coded to create a cache of 1000 entries.

I have an ugly temporary workaround in that I have changed the
CmsTemplateCache "put" method to not store template content in the
template cache if the supplied key matches one of my dynamic pages. This
is the only thing I have found that stops the behaviour, but this cannot
be the solution.

Can someone tell me how to turn this thing off selectively and by
configuration, or at least without having to change the OpenCms code?

Thanks,
         Ivan

-----Original Message-----
From: owner-opencms-dev at www.opencms.org
[mailto:owner-opencms-dev at www.opencms.org] On Behalf Of Hoffmann,
Christian
Sent: Monday, January 20, 2003 00:39
To: 'opencms-dev at www.opencms.org'
Subject: AW: [opencms-dev] Dynamic Pages (template cache)

Hi Ivan,

maybe you should use getCacheDirectives()? It is described in Section
2.3.9
(pages 63-69) in the Manual.

Christian

> -----Ursprüngliche Nachricht-----
> Von: Ivan Biddles [mailto:ivanb at scientology.net] 
> Gesendet: Montag, 20. Januar 2003 09:17
> An: opencms-dev at www.opencms.org
> Betreff: [opencms-dev] Dynamic Pages (template cache)
> 
> 
> Hi,
> 
> I have been struggling with an issue that my dynamic pages 
> are generated once, when online, but then the JSPs are never 
> run again and the same version is always displayed.
> 
> I have specified these pages as "export=dynamic", and 
> everything works perfectly in the off-line project.
> 
> I tracked it down to the "template cache". I had already 
> tried disabling both the element and flex caches without success.
> 
> (The template cache is only mentioned twice in the Manual, 
> both times in the Javadoc section - pages 200 and 215.)
> 
> What I found was that my JSP would run once and then its 
> _output_ would be stored in the template cache. From then on 
> OpenCms simply serves up the page as it was originally created.
> 
> This means that Person A logs in and goes to some page and 
> gets a display of some personal information, let's say. Then 
> Person B does the same thing but he sees Person A's 
> information, because OpenCms is only se5rving up one version 
> of this page.
> 
> In CmsTemplate Cache, I found the following code:
> 
>       // TODO: get the cache-size from properties
>       private CmsCache templateCache = new CmsCache(1000);
> 
> So there is no way to turn off this cache from the property file.
> 
> There must be some way of controlling this behaviour.
> 
> I'm sure others must tried to create dynamic pages, so it 
> must be some setting that I have got wrong somewhere, but I 
> haven't been able to find what it is.
> 
> So any help is urgently needed and would be greatly appreciated.
> 
> Thanks,
>            Ivan
> 




More information about the opencms-dev mailing list