You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Klaus Bertram <k....@kbsm.de> on 2003/02/20 17:46:56 UTC

[PROBLEM] caching after map:aggregate

Hi all,

it seems that there is a caching problem after the map:aggregate module
in the followed transformer
at version 2.0.4 and 2.0.5 it works well but not in 2.1 dev

here a sample:
<map:match pattern="*.html">
   <map:aggregate element="site">
     <map:part src="cocoon:/book-{1}.xml"/>
     <map:part src="cocoon:/body-{1}.xml" label="content"/>
   </map:aggregate>
   <map:transform src="stylesheets/site2xhtml.xsl"/>
   <map:serialize/>
</map:match>

<map:match pattern="body-*.xml">
   <map:generate src="spezification/docs/test.xml"/>
   <map:transform src="stylesheets/site2xhtml.xsl">
     <map:parameter name="use-request-parameters" value="true"/>
    </map:transform>
   <map:serialize type="xml"/>
</map:match>

If index.html is called at the first time it works ok.
If it call's the next times with index.html?id=22 or index.html?id=aass
the first cached side after the aggregation are responded.
Not the new one of generation :(

one solution I found is:
   Set the transformer also to
     <map:parameter name="use-request-parameters" value="true"/>
   and the cache works correct

I think the caching of a transformer result after an aggregation must 
every time based on the request parameter.

Klaus



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [PROBLEM] caching after map:aggregate

Posted by Klaus Bertram <k....@kbsm.de>.
excuse for bothering you

Vadim Gritsenko wrote:
> 
> If pipeline validity for given pipeline key has been changed, then whole 
> result will be recreated.
> 

do you mean like this:
<map:pipeline internal-only="true">
   <map:match pattern="body-*.xml">
     <map:generate src="spezification/docs/test.xml"/>
     <map:transform src="stylesheets/site2xhtml.xsl">
       <map:parameter name="use-request-parameters" value="true"/>
      </map:transform>
     <map:serialize type="xml"/>
   </map:match>
</map:pipline>

<map:pipeline>
   <map:match pattern="*.html">
     <map:aggregate element="site">
      <map:part src="cocoon:/book-{1}.xml"/>
      <map:part src="cocoon:/body-{1}.xml" label="content"/>
     </map:aggregate>
     <map:transform src="stylesheets/site2xhtml.xsl"/>
     <map:serialize/>
   </map:match>
</map:pipeline>

here are also the cached result are diplayed

Klaus


Re: [PROBLEM] caching after map:aggregate

Posted by Vadim Gritsenko <va...@verizon.net>.
Klaus Bertram wrote:

> Vadim Gritsenko wrote:
>
>> Klaus Bertram wrote:
>>
>>> Hi all,
>>>
>>> it seems that there is a caching problem after the map:aggregate module
>>> in the followed transformer
>>> at version 2.0.4 and 2.0.5 it works well but not in 2.1 dev
>>>
>>> here a sample:
>>> <map:match pattern="*.html">
>>>   <map:aggregate element="site">
>>>     <map:part src="cocoon:/book-{1}.xml"/>
>>>     <map:part src="cocoon:/body-{1}.xml" label="content"/>
>>>   </map:aggregate>
>>>   <map:transform src="stylesheets/site2xhtml.xsl"/>
>>>   <map:serialize/>
>>> </map:match>
>>>
>>> <map:match pattern="body-*.xml">
>>>   <map:generate src="spezification/docs/test.xml"/>
>>>   <map:transform src="stylesheets/site2xhtml.xsl">
>>>     <map:parameter name="use-request-parameters" value="true"/>
>>>    </map:transform>
>>>   <map:serialize type="xml"/>
>>> </map:match>
>>>
>>> If index.html is called at the first time it works ok.
>>> If it call's the next times with index.html?id=22 or index.html?id=aass
>>> the first cached side after the aggregation are responded.
>>
>>
>>
>> From what I see, if you remove use-request-parameters parameter, all 
>> requests to the index.html must always return cached result, and 
>> request parameters should not affect this behavior. This means, for 
>> any request like "index.html", "index.html?id=111", 
>> "index.html?whatever=something", response always should be the same 
>> and from the cache.
>>
>> If Cocoon 2.0.4 does not return result from the cache, then it's a bug.
>
> I don't if this is a bug
> Is the content aggregation not a special part for caching?


No, it is not. Pipeline with aggregation is cached as a whole. Parts 
referenced by "cocoon" protocol could be cached separately, because they 
are separate pipelines.


> This means when a aggreagation is processed the caching module should
> look at the part caching key if it changed and generate a new cached 
> result?


If pipeline validity for given pipeline key has been changed, then whole 
result will be recreated.


> This can solved the problem ;)


I don't see a problem, because (when you remove use-request-parameters 
parameter) your sitemap is static thus one and only one cached result 
should be created for index.html and served regardless of request 
parameters.

If you want to vary response based on some request parameter, you need 
to include this request parameter into pipeline key and then results for 
every variation of input parameter will be cached independently. If you 
are using XSP, see cacheable.xsp to get an idea.

Vadim



Re: [PROBLEM] caching after map:aggregate

Posted by Klaus Bertram <k....@kbsm.de>.
Vadim Gritsenko wrote:
> Klaus Bertram wrote:
> 
>> Hi all,
>>
>> it seems that there is a caching problem after the map:aggregate module
>> in the followed transformer
>> at version 2.0.4 and 2.0.5 it works well but not in 2.1 dev
>>
>> here a sample:
>> <map:match pattern="*.html">
>>   <map:aggregate element="site">
>>     <map:part src="cocoon:/book-{1}.xml"/>
>>     <map:part src="cocoon:/body-{1}.xml" label="content"/>
>>   </map:aggregate>
>>   <map:transform src="stylesheets/site2xhtml.xsl"/>
>>   <map:serialize/>
>> </map:match>
>>
>> <map:match pattern="body-*.xml">
>>   <map:generate src="spezification/docs/test.xml"/>
>>   <map:transform src="stylesheets/site2xhtml.xsl">
>>     <map:parameter name="use-request-parameters" value="true"/>
>>    </map:transform>
>>   <map:serialize type="xml"/>
>> </map:match>
>>
>> If index.html is called at the first time it works ok.
>> If it call's the next times with index.html?id=22 or index.html?id=aass
>> the first cached side after the aggregation are responded.
> 
> 
> 
>  From what I see, if you remove use-request-parameters parameter, all 
> requests to the index.html must always return cached result, and request 
> parameters should not affect this behavior. This means, for any request 
> like "index.html", "index.html?id=111", "index.html?whatever=something", 
> response always should be the same and from the cache.
> 
> If Cocoon 2.0.4 does not return result from the cache, then it's a bug.
I don't if this is a bug
Is the content aggregation not a special part for caching?
This means when a aggreagation is processed the caching module should
look at the part caching key if it changed and generate a new cached result?

This can solved the problem ;)

Klaus
> 
> 
> Vadim




Re: [PROBLEM] caching after map:aggregate

Posted by Vadim Gritsenko <va...@verizon.net>.
Leszek Gawron wrote:

>On czw, lut 20, 2003 at 12:34:34 -0500, Vadim Gritsenko wrote:
>  
>
>>Klaus Bertram wrote:
>>
>>    
>>
>>>Hi all,
>>>      
>>>
...

>>If Cocoon 2.0.4 does not return result from the cache, then it's a bug.
>>    
>>
>What you say is maybe true if you want to serve static content
>

Klaus had 100% static sitemap example.


> .. but from
>some time I have the same problem with xsp files which generate content from
>database (it was even ok in cocoon 2.1 2 months old)
>
>I have already described the problem here and in bugzilla:
>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16958 - no response
>

Situation with 2.1 is different. It did not work some time ago for me 
too. It still might have bugs in pipeline implementation, I've not tried 
it since that time yet.

Vadim


>	ouzo
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [PROBLEM] caching after map:aggregate

Posted by Leszek Gawron <ou...@vip.net.pl>.
On czw, lut 20, 2003 at 12:34:34 -0500, Vadim Gritsenko wrote:
> Klaus Bertram wrote:
> 
> >Hi all,
> >
> >it seems that there is a caching problem after the map:aggregate module
> >in the followed transformer
> >at version 2.0.4 and 2.0.5 it works well but not in 2.1 dev
> >
> >here a sample:
> ><map:match pattern="*.html">
> >  <map:aggregate element="site">
> >    <map:part src="cocoon:/book-{1}.xml"/>
> >    <map:part src="cocoon:/body-{1}.xml" label="content"/>
> >  </map:aggregate>
> >  <map:transform src="stylesheets/site2xhtml.xsl"/>
> >  <map:serialize/>
> ></map:match>
> >
> ><map:match pattern="body-*.xml">
> >  <map:generate src="spezification/docs/test.xml"/>
> >  <map:transform src="stylesheets/site2xhtml.xsl">
> >    <map:parameter name="use-request-parameters" value="true"/>
> >   </map:transform>
> >  <map:serialize type="xml"/>
> ></map:match>
> >
> >If index.html is called at the first time it works ok.
> >If it call's the next times with index.html?id=22 or index.html?id=aass
> >the first cached side after the aggregation are responded.
> 
> 
> From what I see, if you remove use-request-parameters parameter, all 
> requests to the index.html must always return cached result, and request 
> parameters should not affect this behavior. This means, for any request 
> like "index.html", "index.html?id=111", "index.html?whatever=something", 
> response always should be the same and from the cache.
> 
> If Cocoon 2.0.4 does not return result from the cache, then it's a bug.
What you say is maybe true if you want to serve static content .. but from
some time I have the same problem with xsp files which generate content from
database (it was even ok in cocoon 2.1 2 months old)

I have already described the problem here and in bugzilla:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16958 - no response
	ouzo


-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/      ouzo@vip.net.pl          _\\()//_
         .'/()\'.     Phone: +48(600)341118     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [PROBLEM] caching after map:aggregate

Posted by Vadim Gritsenko <va...@verizon.net>.
Klaus Bertram wrote:

> Hi all,
>
> it seems that there is a caching problem after the map:aggregate module
> in the followed transformer
> at version 2.0.4 and 2.0.5 it works well but not in 2.1 dev
>
> here a sample:
> <map:match pattern="*.html">
>   <map:aggregate element="site">
>     <map:part src="cocoon:/book-{1}.xml"/>
>     <map:part src="cocoon:/body-{1}.xml" label="content"/>
>   </map:aggregate>
>   <map:transform src="stylesheets/site2xhtml.xsl"/>
>   <map:serialize/>
> </map:match>
>
> <map:match pattern="body-*.xml">
>   <map:generate src="spezification/docs/test.xml"/>
>   <map:transform src="stylesheets/site2xhtml.xsl">
>     <map:parameter name="use-request-parameters" value="true"/>
>    </map:transform>
>   <map:serialize type="xml"/>
> </map:match>
>
> If index.html is called at the first time it works ok.
> If it call's the next times with index.html?id=22 or index.html?id=aass
> the first cached side after the aggregation are responded.


 From what I see, if you remove use-request-parameters parameter, all 
requests to the index.html must always return cached result, and request 
parameters should not affect this behavior. This means, for any request 
like "index.html", "index.html?id=111", "index.html?whatever=something", 
response always should be the same and from the cache.

If Cocoon 2.0.4 does not return result from the cache, then it's a bug.


Vadim


> Not the new one of generation :(
>
> one solution I found is:
>   Set the transformer also to
>     <map:parameter name="use-request-parameters" value="true"/>
>   and the cache works correct
>
> I think the caching of a transformer result after an aggregation must 
> every time based on the request parameter.
>
> Klaus




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org