[opencms-dev] Re: Re: Re: Re: need help: how improving opencmsperformance?

andrea cossu andrea.cossu at gruppoatlantis.com
Thu Feb 1 13:00:07 CET 2007


Unfortunatly the workaround you suggest doesn't work.
I cannot use the cms include directive because in this way the new jsp is 
unable to reach some variables.
I have to use the jsp include, and so doing i get the same working condition 
as before, because the jsp in compiled before the execution, and the code i 
don't want to cache is cached the same.

andrea


Andrea Cossu Divisione Valorizzazione e Promozione Gruppo Atlantis S.p.A. 
Via S. Tomaso D'Aquino, 18 - 09134 Cagliari - Italy Phone: +39.070.22810 302 
Fax: +39.070.22810 364 andrea.cossu at gruppoatlantis.com
"Christian Steinert" <christian_steinert at web.de> ha scritto nel messaggio 
news:233870336 at web.de...
Hi Andrea,

> I tried to apply your suggestion about cache property.
> I have a jsp whith different element included in it, and
> there is an element "menu" that i don't want to cache.
> i set the cache property in this way:
>
>
> cache: element=(anchor,anchorHead,foot,head,home,navigazione,style)
>
>
> but also the element not listed in the element directive, are cached. I
> tried also using the directive no-params=(menu) but nothing changed.
> In the flexcache administration i have this:
>
>
> Resource:
> /system/modules/com.gruppoatlantis.vp.templates/elements/pageselement.jsp
> [online]   Key: no-params=(menu);element;
>         Variation: element=(anchor);
>         Variation: element=(anchorHead);
>         Variation: element=(foot);
>         Variation: element=(head);
>         Variation: element=(home);
>         Variation: element=(menu);
>         Variation: element=(navigazione);
>
> what i have to do to exclude some resource from caching?

Personally, I have only used the cache directives 'true', 'elements' 
(without specifying any element names), 'locale', 'uri', 'parameters=(...)'. 
These settings seem to work as expected. The other directives I have not yet 
used ans so I cannot really say anything about them.

So I have not exactly tried what you are doing.
As I wrote before, I have individual JSP files for each caching strategy. 
These files have different settings for the cache-property and are included 
by my main templates via <cms:include>.

I have never tried to cache only some elements in a JSP file, I only say 
cache="elements" to tell opencms that the output of each element should 
become a different cache variant.

If I cache something in a JSP file, then I cache all elements. Maybe someone 
else knows how to do this - if not, then you could try to move your 
cacheable elements to individual JSP files so that you can control caching 
individually there.

___

Also, I don't have the requirement to exclude elements from caching based on 
a parameter value. For my site, I use parameters to force opencms to create 
different versions of the same element for each parameter value by 
specifying parameters=(...) - directive. But I don't have the need for 
disabling the cache for some parameter values or as soon as a parameter 
appears.

If you don't find a way to control this, then my only idea would be working 
around this problem as follows:
1. - you move your element that is cached only sometimes into a new JSP file 
(e.g. menu.jsp) and don't activate caching for this JSP
2. - you create two more files that include this file:
'menu-cache.jsp' (for this file you configure caching to be active by 
setting the cache property) and 'menu-nocache.jsp' (for this one you don't 
configure caching)

The code of these two files would only be:
  <cms:include file="menu.jsp" />

3. - in your main template you check your request parameter. Based on the 
parameter value, you either include menu-cache.jsp or menu-nocache.jsp

In this way, the code of your main template could indirectly control the 
cache strategy for your element.

This may be a bit roundabout and I have not tried it, but I would expect 
this to work and this approach should give you the desired amount of 
control, if everything else fails.


hth
christian
_______________________________________________________________________
Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222


_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev






More information about the opencms-dev mailing list