caching results of XQueryGenerator!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

caching results of XQueryGenerator!

Евгений-8
I have problem with caching XQueryGenerator results.


if sitemap pipeline include transformer all works rigth:

.....

            <map:match pattern="main/document-fragment">
                <map:generate
src="WEB-INF/xq/etc/main/document-fragment.xq" type="xquery">
                    <map:parameter name="cache-validity" value="3600000"/>
                </map:generate>
                <map:transform src="WEB-INF/xsl/null.xsl"/>
                <map:serialize type="xml"/>
            </map:match>

.......

if sitemap pipeline description is::

.....

            <map:match pattern="main/document-fragment">
                <map:generate
src="WEB-INF/xq/etc/main/document-fragment.xq" type="xquery">
                    <map:parameter name="cache-validity" value="3600000"/>
                </map:generate>
                <map:serialize type="xml"/>
            </map:match>

.......

without transformer, that result of caching don't depent of get
parameters in requested URI.
Result from cache always one for diferent parameters!

This bug of Cocoon or eXist?


P.S. null.xsl:
.....................

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        version="1.0">
       
       

    <xsl:template match="/">
        <xsl:apply-templates/>
    </xsl:template>
   


    <xsl:template match="@*|node()" priority="-1">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>



Evgeny [hidden email]



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: caching results of XQueryGenerator!

Jean-Baptiste Quenot-2
> if sitemap pipeline description is::
>
>            <map:match pattern="main/document-fragment">
>                <map:generate src="WEB-INF/xq/etc/main/document-fragment.xq" type="xquery">
>                    <map:parameter name="cache-validity" value="3600000"/>
>                </map:generate>
>                <map:serialize type="xml"/>
>            </map:match>
>
> without transformer, that result of  caching don't depent of get
> parameters in requested  URI.  Result from cache  always one for
> diferent parameters!

That's perfectly true.  Only the sitemap parameters are taken into
account when building the key identifying the cached object.

Please see how getKey() is implemented.  Currently only
<map:parameter> have influence over the identity of the cached
object.
--
Jean-Baptiste Quenot
Systèmes d'Information
ANYWARE TECHNOLOGIES
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46
http://www.anyware-tech.com/


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Re: caching results of XQueryGenerator!

Евгений-8
Jean-Baptiste Quenot wrote:

>>if sitemap pipeline description is::
>>
>>           <map:match pattern="main/document-fragment">
>>               <map:generate src="WEB-INF/xq/etc/main/document-fragment.xq" type="xquery">
>>                   <map:parameter name="cache-validity" value="3600000"/>
>>               </map:generate>
>>               <map:serialize type="xml"/>
>>           </map:match>
>>
>>without transformer, that result of  caching don't depent of get
>>parameters in requested  URI.  Result from cache  always one for
>>diferent parameters!
>>    
>>
>
>That's perfectly true.  Only the sitemap parameters are taken into
>account when building the key identifying the cached object.
>
>Please see how getKey() is implemented.  Currently only
><map:parameter> have influence over the identity of the cached
>object.
>  
>
 I say about request "get" parameters of URL not </map:parameter>

if sitemap is:
...

<map:match pattern="main/document-fragment">
               <map:generate src="WEB-INF/xq/etc/main/document-fragment.xq" type="xquery">
                   <map:parameter name="cache-validity" value="3600000"/>
               </map:generate>
               <map transformer type="blah-blah-blah"/>
               <map:serialize type="xml"/>
           </map:match>

...

All ok!

But if sitemap is:

...

<map:match pattern="main/document-fragment">
               <map:generate src="WEB-INF/xq/etc/main/document-fragment.xq" type="xquery">
                   <map:parameter name="cache-validity" value="3600000"/>
               </map:generate>
               <map:serialize type="xml"/>
           </map:match>

...

without "transformer", that request  
"http://localhost:8080/document-fragment?any_parameter=blah-blah"
and
"http://localhost:8080/document-fragment?any_parameter1=blah-blah-blah-blah"
are equal.
Second request is result  from cache for first request!

This problem of Cocoon or eXist (getVlidity())?


Evgeny
[hidden email]


P.S.
irc #existdb


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Re: caching results of XQueryGenerator!

Евгений-8
Jean-Baptiste Quenot wrote:

>>without "transformer", that request  "http://localhost:8080/document-fragment?any_parameter=blah-blah"
>>and "http://localhost:8080/document-fragment?any_parameter1=blah-blah-blah-blah" are equal.
>>Second request is result  from cache for first request!
>>    
>>
>
>Of course the requests return the same thing, because
>XQueryGenerator does not take into account the request parameters
>in getKey().
>
>Is your XQuery using request parameters to build its result?  Is
>it possible to pass them as sitemap parameters instead?
>  
>

Not of course!

XQueryGenerator does take into account the request parameters
in getKey() as URI:
......
key.append(inputSource.getURI());
......

And if "transformer" present, first request diferent from second!
And both requests stored in the cache by diferent account.






-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open