You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gr...@apache.org on 2001/01/19 00:40:20 UTC

cvs commit: xml-cocoon/samples/fp index.xml

greenrd     01/01/18 15:40:20

  Modified:    xdocs    caching.xml
               src/org/apache/cocoon Engine.java Defaults.java
               .        changes.xml
               samples/fp index.xml
  Log:
  added pi to disable caching, primarily for fp
  
  Revision  Changes    Path
  1.4       +9 -0      xml-cocoon/xdocs/caching.xml
  
  Index: caching.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/xdocs/caching.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- caching.xml	2000/11/21 23:38:23	1.3
  +++ caching.xml	2001/01/18 23:40:17	1.4
  @@ -23,6 +23,8 @@
     <p>
      Please read the comments in <code>cocoon.properties</code> for an
      explanation of the global caching parameters that Cocoon accepts.
  +   In particular, disabling Last-Modified support appears to disable all
  +   <em>external</em> caching (i.e. caching in web browsers, proxies, etc.)
     </p>
   
     <s2 title="What is cached and what is not?">
  @@ -43,6 +45,13 @@
       such as PUT are never cached under any circumstances (however, POST is
       not one of these types - although 99% of the time it is not advisable to
       cache a POST request, it is possible to do so.)
  +   </p>
  +
  +   <p>
  +    The easiest way to disable caching for a particular page is to add
  +    the <code>&lt;?cocoon-disable-caching?&gt;</code> processing instruction.
  +    (But this won't work if inserted dynamically, except if it is inserted by
  +     a Producer.)
      </p>
    
      <note>This document is accurate with respect to Cocoon 1.8.1. Older and
  
  
  
  1.46      +13 -2     xml-cocoon/src/org/apache/cocoon/Engine.java
  
  Index: Engine.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Engine.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Engine.java	2001/01/16 15:50:29	1.45
  +++ Engine.java	2001/01/18 23:40:18	1.46
  @@ -1,4 +1,4 @@
  -/*-- $Id: Engine.java,v 1.45 2001/01/16 15:50:29 greenrd Exp $ --
  +/*-- $Id: Engine.java,v 1.46 2001/01/18 23:40:18 greenrd Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -77,11 +77,17 @@
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
    * @author <a href="mailto:greenrd@hotmail.com">Robin Green</a>
  - * @version $Revision: 1.45 $ $Date: 2001/01/16 15:50:29 $
  + * @version $Revision: 1.46 $ $Date: 2001/01/18 23:40:18 $
    */
   
   public class Engine implements Defaults {
   
  +    public static final Changeable UNCACHEABLE = new Changeable () {
  +      public boolean hasChanged (Object context) {
  +        return true;
  +      }
  +    };
  +
       private Block blocker = new Block();
       private boolean VERBOSE, PROFILE, LASTMODIFIED;
   
  @@ -354,6 +360,11 @@
                           if (PROFILE) profiler.finishEvent (requestMarker, producer.getClass ());
   
                           if (LOG) logger.log(this, "Document produced", Logger.DEBUG);
  +
  +                        // See if disable caching processing instruction exists
  +                        if (Utils.getFirstPI (document, DISABLE_CACHING_PI, true) != null) {
  +                            page.setChangeable (UNCACHEABLE);
  +                        }
   
                           // pass needed parameters to the processor pipeline
                           Hashtable environment = new Hashtable();
  
  
  
  1.14      +4 -3      xml-cocoon/src/org/apache/cocoon/Defaults.java
  
  Index: Defaults.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Defaults.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Defaults.java	2000/09/16 16:04:29	1.13
  +++ Defaults.java	2001/01/18 23:40:18	1.14
  @@ -1,4 +1,4 @@
  -/*-- $Id: Defaults.java,v 1.13 2000/09/16 16:04:29 greenrd Exp $ --
  +/*-- $Id: Defaults.java,v 1.14 2001/01/18 23:40:18 greenrd Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -54,7 +54,7 @@
    * The Cocoon strings.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version $Revision: 1.13 $ $Date: 2000/09/16 16:04:29 $
  + * @version $Revision: 1.14 $ $Date: 2001/01/18 23:40:18 $
    */
   
   public interface Defaults {
  @@ -94,6 +94,7 @@
       public static final String COCOON_PROCESS_PI = "cocoon-process";
       public static final String COCOON_FORMAT_PI = "cocoon-format";
       public static final String STYLESHEET_PI = "xml-stylesheet";
  +    public static final String DISABLE_CACHING_PI = "cocoon-disable-caching";
   
       public static final String DEFAULT_BROWSER = "default";
   
  @@ -104,4 +105,4 @@
       // Profiler event types. These need to be valid XML names - no spaces.
       public static final String WHOLE_REQUEST = "Whole-request",
         OUTPUTTING = "Outputting";
  -}
  \ No newline at end of file
  +}
  
  
  
  1.181     +7 -1      xml-cocoon/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/changes.xml,v
  retrieving revision 1.180
  retrieving revision 1.181
  diff -u -r1.180 -r1.181
  --- changes.xml	2001/01/17 16:02:19	1.180
  +++ changes.xml	2001/01/18 23:40:19	1.181
  @@ -4,7 +4,7 @@
   
   <!--
     History of Cocoon changes   
  -  $Id: changes.xml,v 1.180 2001/01/17 16:02:19 greenrd Exp $ 
  +  $Id: changes.xml,v 1.181 2001/01/18 23:40:19 greenrd Exp $ 
   -->
   
   <changes title="History of Changes">
  @@ -18,6 +18,12 @@
     </devs>
   
    <release version="@version@" date="@date@">
  +  <action dev="RDG" type="add">
  +   Added &lt;?cocoon-disable-caching?&gt; processing instruction to disable
  +   caching for a page. This is most useful for cases like samples/fp,
  +   which behaves strangely without it, because of Last-Modified support
  +   introduced in Cocoon 1.8.1.
  +  </action>
     <action dev="RDG" type="update">
      Obsolete XObject now replaced by org.apache.cocoon.xml.XMLFragment. 
      This change was necessitated by the move to SAX2 in Cocoon 2.
  
  
  
  1.3       +4 -0      xml-cocoon/samples/fp/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/fp/index.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.xml	2000/07/21 23:37:22	1.2
  +++ index.xml	2001/01/18 23:40:20	1.3
  @@ -1,5 +1,9 @@
   <?xml version="1.0"?>
   <!-- Written by Jeremy Quinn "sharkbait@mac.com" -->
  +
  +<!-- Disable caching for this page -->
  +<?cocoon-disable-caching?>
  +
   <?cocoon-process type="xslt"?>
   <?xml-stylesheet href="page-html.xsl" type="text/xsl"?>
   <page>