You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dan <da...@porkfriedrice.net> on 2004/01/09 21:16:22 UTC
cache problem
Hello,
I'm having a cache-related problem but I don't know how to diagnose it.
What is happening is that for a few (not all) of my requests, cocoon
returns the wrong file. For example, my sitemap entry is:
<map:match pattern="docs/*_main.html">
<map:generate src="xml/{1}.xml"/>
<map:transform src="stylesheets/main.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="docs/*_main.html">
<map:generate src="xml/{1}.xml"/>
<map:transform src="stylesheets/contacts.xsl"/>
<map:serialize/>
</map:match>
For a couple of requests, for example requesting /docs/file1_main.html i
get file80.xml with the main.xsl stylesheet applied to it where I should
have gotten file1.xml with main.xsl applied. For some other requests,
cocoon not only returns the wrong file, but applies the wrong
stylesheet. For example requesting /docs/file30_main.html gets me file40
with contacts.xsl stylesheet applied.
This behavior only happens for a requests, but for those requests, it
happens consistently. Most requests are just fine and return what they
should.
I know its a cache problem because I can stop tomcat, delete the cache
directory and restart and the problem goes away. I don't know much about
how caching is implemented so I don't know how to approach this
problem. I figure someone has seen it before though, so any pointers
would be appreciated. The problem seems to happen after the application
has been running for a while and its cache file gets big. When I last
saw this problem, the cocoon-cache.dat file was approximately 900MB.
Clearing the cache when this happens is not a real solution as the xml
files I'm using are quite big and having things cached is a big
performance bonus.
My app is based on Cocoon 2.0.3 and is running under Tomcat 4.1.18.
Thanks,
Dan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: cache problem
Posted by Dan <da...@porkfriedrice.net>.
Jorg Heymans wrote:
>
> Dan wrote:
>
>> Hello,
>>
>> I'm having a cache-related problem but I don't know how to diagnose
>> it. What is happening is that for a few (not all) of my requests,
>> cocoon returns the wrong file. For example, my sitemap entry is:
>>
>> <map:match pattern="docs/*_main.html">
>> <map:generate src="xml/{1}.xml"/>
>> <map:transform src="stylesheets/main.xsl"/>
>> <map:serialize/>
>> </map:match>
>>
>> <map:match pattern="docs/*_main.html">
>> <map:generate src="xml/{1}.xml"/>
>> <map:transform src="stylesheets/contacts.xsl"/>
>> <map:serialize/>
>> </map:match>
>
>
> I don't understand.
> 1) If a request is cached then none of your pipeline components get
> executed at all
> 2) Given above sitemap fragment (in that order), no request can reach
> the second pipeline because you're matching on the same pattern
> docs/*_main.html.
You're absolutely right. The actual sitemap fragment is more complicated
so I simplified things when I gave the sample fragments and copied and
pasted too hastily. The second match fragment should match
pattern="docs/*_contacts.html"
> 3) Are you sure you're getting back the data you think you're getting
> back? Try adding debug views so you can verify each step in the pipeline.
> Is upgrading to 2.0.4 an option? Try searching nagoya.apache.org for
> open/solved bugs in the cocoon 2.0 branch, maybe it has come up before.
I already cleared the cache, which solves the problem (temporarily) so I
can't debug with views. I guess I'll have to wait until this behavior
happens again and try that out, but as you say, the pipeline components
don't get executed at all so that wouldn't really help. So I guess I'll
upgrade and if that doesn't help, I'll be searching through the bug
reports. :)
Thanks for your suggestions,
Dan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: cache problem
Posted by Jorg Heymans <jh...@domek.be>.
Dan wrote:
> Hello,
>
> I'm having a cache-related problem but I don't know how to diagnose it.
> What is happening is that for a few (not all) of my requests, cocoon
> returns the wrong file. For example, my sitemap entry is:
>
> <map:match pattern="docs/*_main.html">
> <map:generate src="xml/{1}.xml"/>
> <map:transform src="stylesheets/main.xsl"/>
> <map:serialize/>
> </map:match>
>
> <map:match pattern="docs/*_main.html">
> <map:generate src="xml/{1}.xml"/>
> <map:transform src="stylesheets/contacts.xsl"/>
> <map:serialize/>
> </map:match>
I don't understand.
1) If a request is cached then none of your pipeline components get
executed at all
2) Given above sitemap fragment (in that order), no request can reach
the second pipeline because you're matching on the same pattern
docs/*_main.html.
3) Are you sure you're getting back the data you think you're getting
back? Try adding debug views so you can verify each step in the pipeline.
Is upgrading to 2.0.4 an option? Try searching nagoya.apache.org for
open/solved bugs in the cocoon 2.0 branch, maybe it has come up before.
Regards
Jorg
>
> For a couple of requests, for example requesting /docs/file1_main.html i
> get file80.xml with the main.xsl stylesheet applied to it where I should
> have gotten file1.xml with main.xsl applied. For some other requests,
> cocoon not only returns the wrong file, but applies the wrong
> stylesheet. For example requesting /docs/file30_main.html gets me file40
> with contacts.xsl stylesheet applied.
>
> This behavior only happens for a requests, but for those requests, it
> happens consistently. Most requests are just fine and return what they
> should.
>
> I know its a cache problem because I can stop tomcat, delete the cache
> directory and restart and the problem goes away. I don't know much about
> how caching is implemented so I don't know how to approach this
> problem. I figure someone has seen it before though, so any pointers
> would be appreciated. The problem seems to happen after the application
> has been running for a while and its cache file gets big. When I last
> saw this problem, the cocoon-cache.dat file was approximately 900MB.
> Clearing the cache when this happens is not a real solution as the xml
> files I'm using are quite big and having things cached is a big
> performance bonus.
>
> My app is based on Cocoon 2.0.3 and is running under Tomcat 4.1.18.
>
> Thanks,
> Dan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org