The question is: Am I doing something wrong? Or is it a bug in stylesheets caching?
It's bug (or limitation) in stylesheet caching. Make an entry in Bugzilla, and avoid using cocoon: urls in xsl:include. Alternatively, you can try adding host into the cocoon: url itself:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="cocoon:/layout.xsl?host=foo"/>
</xsl:stylesheet>But it probably will cause invalidation of xslt cache on every other request, which is sub optimal.
Vadim
