You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hugh Sparks <hu...@csparks.com> on 2010/06/16 10:17:38 UTC

[C3] How to prevent caching a stylesheet?

The following pipeline (I think) is configured to be
noncaching, but editing the stylesheet.xsl file has
no visible effect when the browser page is refreshed
(and the browser cache is cleared.)


<map:pipeline type="noncaching">

    <map:match pattern="{name}.xml">
        <map:generate src="{map:name}.xml"/>
        <map:transform src="stylesheet.xsl"/>
        <map:serialize type="html"/>
    </map:match>
    ...
...

I'm using tomcat with all context "out of the jar".

Is there some other "noncaching" thing I should specify
so changes to the stylesheet become visible without
reloading the spring context?

Thanks!

-Hugh Sparks

Re: [C3] How to prevent caching a stylesheet?

Posted by Steven Dolg <st...@indoqa.com>.
Hi,

no, there is no further caching setting you could use and there should 
be no caching with the configuration you described.

However, after looking at some code I found this in the XSLTTransformer:

   private void loadXSLT(final URL source, final Map<String, Object> attributes) {
        if (source == null) {
            throw new IllegalArgumentException("The parameter 'source' mustn't be null.");
        }

        this.source = source;

        // check the XSLT is in the cache first
        if (XSLT_CACHE.containsKey(source)) {
            // get the XSLT directly from the cache
            this.templates = XSLT_CACHE.get(this.source);
	} else {

	...


I'm not really up-to-date but it looks like there is no way to affect 
this behaviour in any way.
So sadly this appears to be a genuine deficiency in trunk (which been 
there since at least early January).

I'm afraid there is no solution for this readily available (except the 
obvious restart)

Steven



Hugh Sparks schrieb:
> The following pipeline (I think) is configured to be
> noncaching, but editing the stylesheet.xsl file has
> no visible effect when the browser page is refreshed
> (and the browser cache is cleared.)
>  
>  
> <map:pipeline type="noncaching">
>  
>     <map:match pattern="{name}.xml">
>         <map:generate src="{map:name}.xml"/>
>         <map:transform src="stylesheet.xsl"/>
>         <map:serialize type="html"/>
>     </map:match>
>     ...
> ...
>  
> I'm using tomcat with all context "out of the jar".
>  
> Is there some other "noncaching" thing I should specify
> so changes to the stylesheet become visible without
> reloading the spring context?
>  
> Thanks!
>  
> -Hugh Sparks
>  


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