This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git

commit 9315fb2a2cd47b77880d8d052c79afb7b329fec7
Author: juanpablo <juanpa...@apache.org>
AuthorDate: Sun Jan 28 01:47:18 2018 +0100

    JSPWIKI-1064: the page render cache must also take into account if the 
plugins should be rendered or not.
---
 .../src/main/java/org/apache/wiki/render/RenderingManager.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/jspwiki-war/src/main/java/org/apache/wiki/render/RenderingManager.java 
b/jspwiki-war/src/main/java/org/apache/wiki/render/RenderingManager.java
index a8dd7fd..aaa123a 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/render/RenderingManager.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/render/RenderingManager.java
@@ -196,7 +196,9 @@ public class RenderingManager implements WikiEventListener, 
InternalModule
      */
     // FIXME: The cache management policy is not very good: deleted/changed 
pages should be detected better.
     protected WikiDocument getRenderedDocument( WikiContext context, String 
pagedata ) throws IOException {
-        String pageid = context.getRealPage().getName() + VERSION_DELIMITER + 
context.getRealPage().getVersion();
+        String pageid = context.getRealPage().getName() + VERSION_DELIMITER +
+                        context.getRealPage().getVersion() + VERSION_DELIMITER 
+
+                        context.getVariable( 
RenderingManager.VAR_EXECUTE_PLUGINS );
 
         if( useCache( context ) ) {
             Element element = m_documentCache.get( pageid );
@@ -363,7 +365,9 @@ public class RenderingManager implements WikiEventListener, 
InternalModule
                             if( log.isDebugEnabled() ) {
                                 log.debug( "Flushing latest version of " + 
page );
                             }
-                            m_documentCache.remove( page + VERSION_DELIMITER + 
WikiPageProvider.LATEST_VERSION );
+                            // as there is a new version of the page expire 
both plugin and pluginless versions of the old page
+                            m_documentCache.remove( page + VERSION_DELIMITER + 
WikiPageProvider.LATEST_VERSION  + VERSION_DELIMITER + Boolean.FALSE );
+                            m_documentCache.remove( page + VERSION_DELIMITER + 
WikiPageProvider.LATEST_VERSION  + VERSION_DELIMITER + Boolean.TRUE );
                         }
                     }
                 }

-- 
To stop receiving notification emails like this one, please contact
juanpa...@apache.org.

Reply via email to