[xwiki-users] xwiki render cache not working?
Hello, i have a specific wiki page that is quite slow to render because some groovy code and macros in there are quite slow. Fortunately, content does not change often, si i tried to make it faster for user by using cache rendering. Here is what is inside my xwiki.cfg: xwiki.rendering.defaultCacheDuration=3600 And here is my xwiki.properties core.renderingcache.enabled=true core.renderingcache.documents=wiki:.* core.renderingcache.size=200 # Default value is 300 (5 min). # core.renderingcache.duration=300 I have also this inside my page: {{velocity}} $context.setCacheDuration(60) //complex content here that has a custom groovy macro and a velocity include {{/velocity}} {{groovy}} System.out.println("***************************************phone menu not in cache") {{/groovy}} And i see in my log that, everytime, the System.out is executed, meaning the render cache is not used. What's my configuration problem? What did i miss? Note: using xwiki 4.1.2 and the url i try is http://server/xwiki/bin/view/MySpace/MyPage?menu=Test.Menu&xpage=plain Thank you. David Delbecq
On Wed, Dec 5, 2012 at 3:29 PM, David Delbecq <[email protected]>wrote:
Hello,
i have a specific wiki page that is quite slow to render because some groovy code and macros in there are quite slow. Fortunately, content does not change often, si i tried to make it faster for user by using cache rendering.
Here is what is inside my xwiki.cfg:
xwiki.rendering.defaultCacheDuration=3600
And here is my xwiki.properties
core.renderingcache.enabled=true core.renderingcache.documents=wiki:.* core.renderingcache.size=200 # Default value is 300 (5 min). # core.renderingcache.duration=300
I have also this inside my page:
{{velocity}} $context.setCacheDuration(60) //complex content here that has a custom groovy macro and a velocity include {{/velocity}}
{{groovy}} System.out.println("***************************************phone menu not in cache") {{/groovy}}
And i see in my log that, everytime, the System.out is executed, meaning the render cache is not used. What's my configuration problem? What did i miss?
Note: using xwiki 4.1.2 and the url i try is http://server/xwiki/bin/view/MySpace/MyPage?menu=Test.Menu&xpage=plain
Thank you.
David Delbecq
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Rendering cache works well for me. First of all, not that your are mixing two different features here: what you find in xwiki.cfg and $context.setCacheDuration() are old caching system which is maintained for retro-compatibility reasons only in xwiki/1.0 syntax. Now about the more generic rendering cache located in xwiki.properties, is your wiki name really "wiki" ? Because here you indicated that you wanted to cache all the pages in the wiki which has "wiki" as identifier. If you are in a single wiki mode (XWiki Enterprise for example) you can simply remove the wiki part as in core.renderingcache.documents=Space.Page -- Thomas Mortagne
Rendering cache works well for me. Well, quite obviously, not for me :) First of all, not that your are mixing two different features here: what you find in xwiki.cfg and $context.setCacheDuration() are old caching system which is maintained for retro-compatibility reasons only in xwiki/1.0 syntax. If setCacheDuration does not work in xwiki 2, how do i specify per page cache rules? Going through the process of shuting down xwiki to adjust .properties for each page that requires cache disabling can quickly beocme a nightmare. Now about the more generic rendering cache located in xwiki.properties, is your wiki name really "wiki" ? Because here you indicated that you wanted to cache all the pages in the wiki which has "wiki" as identifier. If you are in a single wiki mode (XWiki Enterprise for example) you can simply remove the wiki part as in core.renderingcache.documents=Space.Page I thought xwiki was the default wiki name :) However, here is adujsted config: still the same problem. As you can see, i asked to cache *everything* :) #-# [Since 2.4M1] #-# A list of Java regex patterns matching full documents reference. # core.renderingcache.documents=wiki:Space\.Page # core.renderingcache.documents=wiki:Space\..* core.renderingcache.documents=.* #-# [Since 2.4M1] #-# The time (in seconds) after which data should be removed from the cache when not used. #-# Default value is 300 (5 min). # core.renderingcache.duration=300 #-# [Since 2.4M1] #-# The size of the rendering cache. Not that it's not the number of cached documents but the number of cached results. #-# (For a single document several cache entries are created, because each action, language and request query string #-# produces a unique rendering result) #-# Default value is 100. core.renderingcache.size=200 Here is my log output, if that can be of any use: 12:15:44,611 INFO [stdout] (http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) ***************************************phone menu not in cache 12:15:45,327 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%...) No FormBeanConfig found under 'download' 12:15:45,342 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:15:45,327 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:15:59,560 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) No FormBeanConfig found under 'view' 12:16:00,377 INFO [stdout] (http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) ***************************************phone menu not in cache 12:16:00,496 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%...) No FormBeanConfig found under 'download' 12:16:00,497 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:16:00,496 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:19:06,714 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) No FormBeanConfig found under 'view' 12:19:07,520 INFO [stdout] (http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) ***************************************phone menu not in cache 12:19:07,601 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:19:07,609 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%...) No FormBeanConfig found under 'download' 12:19:07,647 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:19:09,749 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) No FormBeanConfig found under 'view' 12:19:10,440 INFO [stdout] (http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) ***************************************phone menu not in cache 12:19:10,556 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%...) No FormBeanConfig found under 'download' 12:19:10,558 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:19:10,563 WARN [org.apache.struts.util.RequestUtils] (http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' Also, is there some way i can debug log the cache works so i can see what is happening? David Delbecq David Delbecq
On Thu, Dec 6, 2012 at 1:26 PM, David Delbecq <[email protected]>wrote:
Rendering cache works well for me.
Well, quite obviously, not for me :)
First of all, not that your are mixing two different features here: what you find in xwiki.cfg and $context.setCacheDuration() are old caching system which is maintained for retro-compatibility reasons only in xwiki/1.0 syntax.
If setCacheDuration does not work in xwiki 2, how do i specify per page cache rules? Going through the process of shuting down xwiki to adjust .properties for each page that requires cache disabling can quickly beocme a nightmare.
You can also use cache macro (see http://extensions.xwiki.org/xwiki/bin/view/Extension/Cache+Macro) to choose different timing for each contents.
Now about the more generic rendering cache located in xwiki.properties, is your wiki name really "wiki" ? Because here you indicated that you wanted to cache all the pages in the wiki which has "wiki" as identifier. If you are in a single wiki mode (XWiki Enterprise for example) you can simply remove the wiki part as in
core.renderingcache.documents=Space.Page
I thought xwiki was the default wiki name :) However, here is adujsted config: still the same problem. As you can see, i asked to cache *everything* :)
#-# [Since 2.4M1] #-# A list of Java regex patterns matching full documents reference. # core.renderingcache.documents=wiki:Space\.Page # core.renderingcache.documents=wiki:Space\..* core.renderingcache.documents=.*
#-# [Since 2.4M1] #-# The time (in seconds) after which data should be removed from the cache when not used. #-# Default value is 300 (5 min). # core.renderingcache.duration=300
#-# [Since 2.4M1] #-# The size of the rendering cache. Not that it's not the number of cached documents but the number of cached results. #-# (For a single document several cache entries are created, because each action, language and request query string #-# produces a unique rendering result) #-# Default value is 100. core.renderingcache.size=200
Did you kept core.renderingcache.enabled=true ?
Here is my log output, if that can be of any use: 12:15:44,611 INFO [stdout] ( http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) ***************************************phone menu not in cache 12:15:45,327 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%...) No FormBeanConfig found under 'download' 12:15:45,342 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:15:45,327 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:15:59,560 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) No FormBeanConfig found under 'view' 12:16:00,377 INFO [stdout] ( http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) ***************************************phone menu not in cache 12:16:00,496 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%...) No FormBeanConfig found under 'download' 12:16:00,497 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:16:00,496 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:19:06,714 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) No FormBeanConfig found under 'view' 12:19:07,520 INFO [stdout] ( http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) ***************************************phone menu not in cache 12:19:07,601 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:19:07,609 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%...) No FormBeanConfig found under 'download' 12:19:07,647 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:19:09,749 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) No FormBeanConfig found under 'view' 12:19:10,440 INFO [stdout] ( http://someServer.meteo.be:10080/xwiki/bin/view/Configuration/PhoneMacro?men...) ***************************************phone menu not in cache 12:19:10,556 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/Menu/edit%...) No FormBeanConfig found under 'download' 12:19:10,558 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download' 12:19:10,563 WARN [org.apache.struts.util.RequestUtils] ( http://someServer.meteo.be:10080/xwiki/bin/download/Configuration/PhoneMenuS...) No FormBeanConfig found under 'download'
Also, is there some way i can debug log the cache works so i can see what is happening?
There is no debug log but you add some in https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwik... using Byteman. See http://dev.xwiki.org/xwiki/bin/view/Community/Debugging#HUsingByteman for more details.
David Delbecq
David Delbecq _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Hello, i did a step by step analysis of the problem using eclipse debugger and i found the culprit. Before i submit a bugreport, can someone confirm me this is unexpected behaviour? Inside com.xpn.xwiki.internal.cache.rendering.DefaultRenderingCache.getRenderedContent(DocumentReference documentReference, String source, XWikiContext context), there is a call to this.cache.get(documentReference, source, getAction(context), context.getLanguage(), getRequestParameters(context)); which uses this information to generate a cache Key that is then looked up in cache. However, getRequestParameters(context) in my case is returning {menu=[Ljava.lang.String;@3e5da853, xpage=[Ljava.lang.String;@76d60121} where it should return something like {menu={SysAdminRmi.Menu}, xpage={plain}} As a result, my cache key change at each reaquest because values are not properly used and so even if my page is cache, it's never rendered from cache. Reason, behind this is this code in getRequestParameters: Map<String, String> parameters = context.getRequest().getParameterMap(); ... return parameters.toString(); This map is generated by com.xpn.xwiki.web.XWikiServletRequest.getParameterMap, and is Map<String,Object> and not a Map<String,String>! Here is the proving code public Map getParameterMap() { Map newMap = new HashMap(); Map map = this.request.getParameterMap(); Iterator it = map.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); Object value = map.get(key); if (value instanceof String) { newMap.put(key, filterString((String) value)); } else if (value instanceof String[]) { newMap.put(key, filterStringArray((String[]) value)); } else { newMap.put(key, value); } } return map; } Clearly, In my case, catalina request facade does decode so that ParameterMap return Map<String,String[1 ]> instead of Map<String,String>. Consequences? Cache only works when there are no request parameters. Is there some way for me to replace DefaultRenderingCache with another implementation i write that does not have this issue, as a temporary solution? ----- Mail original ----- De: "Thomas Mortagne" <[email protected]> À: "XWiki Users" <[email protected]> Envoyé: Mercredi 5 Décembre 2012 18:05:59 Objet: Re: [xwiki-users] xwiki render cache not working? On Wed, Dec 5, 2012 at 3:29 PM, David Delbecq <[email protected]>wrote:
Hello,
i have a specific wiki page that is quite slow to render because some groovy code and macros in there are quite slow. Fortunately, content does not change often, si i tried to make it faster for user by using cache rendering.
Here is what is inside my xwiki.cfg:
xwiki.rendering.defaultCacheDuration=3600
And here is my xwiki.properties
core.renderingcache.enabled=true core.renderingcache.documents=wiki:.* core.renderingcache.size=200 # Default value is 300 (5 min). # core.renderingcache.duration=300
I have also this inside my page:
{{velocity}} $context.setCacheDuration(60) //complex content here that has a custom groovy macro and a velocity include {{/velocity}}
{{groovy}} System.out.println("***************************************phone menu not in cache") {{/groovy}}
And i see in my log that, everytime, the System.out is executed, meaning the render cache is not used. What's my configuration problem? What did i miss?
Note: using xwiki 4.1.2 and the url i try is http://server/xwiki/bin/view/MySpace/MyPage?menu=Test.Menu&xpage=plain
Thank you.
David Delbecq
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Rendering cache works well for me. First of all, not that your are mixing two different features here: what you find in xwiki.cfg and $context.setCacheDuration() are old caching system which is maintained for retro-compatibility reasons only in xwiki/1.0 syntax. Now about the more generic rendering cache located in xwiki.properties, is your wiki name really "wiki" ? Because here you indicated that you wanted to cache all the pages in the wiki which has "wiki" as identifier. If you are in a single wiki mode (XWiki Enterprise for example) you can simply remove the wiki part as in core.renderingcache.documents=Space.Page -- Thomas Mortagne _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hello, i did a step by step analysis of the problem using eclipse debugger and i found the culprit. Before i submit a bugreport, can someone confirm me this is unexpected behaviour? Inside com.xpn.xwiki.internal.cache.rendering.DefaultRenderingCache.getRenderedContent(DocumentReference documentReference, String source, XWikiContext context), there is a call to this.cache.get(documentReference, source, getAction(context), context.getLanguage(), getRequestParameters(context)); which uses this information to generate a cache Key that is then looked up in cache. However, getRequestParameters(context) in my case is returning {menu=[Ljava.lang.String;@3e5da853, xpage=[Ljava.lang.String;@76d60121} where it should return something like {menu={SysAdminRmi.Menu}, xpage={plain}} As a result, my cache key change at each reaquest because values are not properly used and so even if my page is cache, it's never rendered from cache. Reason, behind this is this code in getRequestParameters: Map<String, String> parameters = context.getRequest().getParameterMap(); ... return parameters.toString(); This map is generated by com.xpn.xwiki.web.XWikiServletRequest.getParameterMap, and is Map<String,Object> and not a Map<String,String>! Here is the proving code public Map getParameterMap() { Map newMap = new HashMap(); Map map = this.request.getParameterMap(); Iterator it = map.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); Object value = map.get(key); if (value instanceof String) { newMap.put(key, filterString((String) value)); } else if (value instanceof String[]) { newMap.put(key, filterStringArray((String[]) value)); } else { newMap.put(key, value); } } return map; } Clearly, In my case, catalina request facade does decode so that ParameterMap return Map<String,String[1]> instead of Map<String,String>. Consequences? Cache only works when there are no request parameters. Is there some way for me to replace DefaultRenderingCache with another implementation i write that does not have this issue, as a temporary solution? ----- Mail original ----- De: "Thomas Mortagne" <[email protected]> À: "XWiki Users" <[email protected]> Envoyé: Mercredi 5 Décembre 2012 18:05:59 Objet: Re: [xwiki-users] xwiki render cache not working? On Wed, Dec 5, 2012 at 3:29 PM, David Delbecq <[email protected]>wrote:
Hello,
i have a specific wiki page that is quite slow to render because some groovy code and macros in there are quite slow. Fortunately, content does not change often, si i tried to make it faster for user by using cache rendering.
Here is what is inside my xwiki.cfg:
xwiki.rendering.defaultCacheDuration=3600
And here is my xwiki.properties
core.renderingcache.enabled=true core.renderingcache.documents=wiki:.* core.renderingcache.size=200 # Default value is 300 (5 min). # core.renderingcache.duration=300
I have also this inside my page:
{{velocity}} $context.setCacheDuration(60) //complex content here that has a custom groovy macro and a velocity include {{/velocity}}
{{groovy}} System.out.println("***************************************phone menu not in cache") {{/groovy}}
And i see in my log that, everytime, the System.out is executed, meaning the render cache is not used. What's my configuration problem? What did i miss?
Note: using xwiki 4.1.2 and the url i try is http://server/xwiki/bin/view/MySpace/MyPage?menu=Test.Menu&xpage=plain
Thank you.
David Delbecq
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Rendering cache works well for me. First of all, not that your are mixing two different features here: what you find in xwiki.cfg and $context.setCacheDuration() are old caching system which is maintained for retro-compatibility reasons only in xwiki/1.0 syntax. Now about the more generic rendering cache located in xwiki.properties, is your wiki name really "wiki" ? Because here you indicated that you wanted to cache all the pages in the wiki which has "wiki" as identifier. If you are in a single wiki mode (XWiki Enterprise for example) you can simply remove the wiki part as in core.renderingcache.documents=Space.Page -- Thomas Mortagne _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On Thu, Dec 6, 2012 at 3:37 PM, David Delbecq <[email protected]> wrote:
Hello,
i did a step by step analysis of the problem using eclipse debugger and i found the culprit. Before i submit a bugreport, can someone confirm me this is unexpected behaviour?
Inside com.xpn.xwiki.internal.cache.rendering.DefaultRenderingCache.getRenderedContent(DocumentReference documentReference, String source, XWikiContext context), there is a call to
this.cache.get(documentReference, source, getAction(context), context.getLanguage(), getRequestParameters(context)); which uses this information to generate a cache Key that is then looked up in cache.
However, getRequestParameters(context) in my case is returning
{menu=[Ljava.lang.String;@3e5da853, xpage=[Ljava.lang.String;@76d60121}
This is the expected output of calling toString() on a Map<String, String[]>. The bug is that the code in DefaultRenderingCache wrongly assumes that the request parameters are stored in a Map<String, String>.
where it should return something like {menu={SysAdminRmi.Menu}, xpage={plain}} As a result, my cache key change at each reaquest because values are not properly used and so even if my page is cache, it's never rendered from cache.
Reason, behind this is this code in getRequestParameters:
Map<String, String> parameters = context.getRequest().getParameterMap(); ... return parameters.toString();
This map is generated by com.xpn.xwiki.web.XWikiServletRequest.getParameterMap, and is Map<String,Object> and not a Map<String,String>! Here is the proving code
See http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getPar... . The return value is clear, Map<String, String[]>. DefaultRenderingCache#getRequestParameters() needs to be fixed to serialize the map correctly, and the best way is to serialize it as a query string.
public Map getParameterMap() { Map newMap = new HashMap(); Map map = this.request.getParameterMap(); Iterator it = map.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); Object value = map.get(key); if (value instanceof String) { newMap.put(key, filterString((String) value)); } else if (value instanceof String[]) { newMap.put(key, filterStringArray((String[]) value)); } else { newMap.put(key, value); } } return map; }
Clearly, In my case, catalina request facade does decode so that ParameterMap return Map<String,String[1 ]> instead of Map<String,String>.
Consequences? Cache only works when there are no request parameters.
Is there some way for me to replace DefaultRenderingCache with another implementation i write that does not have this issue, as a temporary solution?
Yes, because DefaultRenderingCache is a component implementation. See http://extensions.xwiki.org/xwiki/bin/view/Extension/Component+Module#HOverr... . Hope this helps, Marius
----- Mail original -----
De: "Thomas Mortagne" <[email protected]> À: "XWiki Users" <[email protected]> Envoyé: Mercredi 5 Décembre 2012 18:05:59 Objet: Re: [xwiki-users] xwiki render cache not working?
On Wed, Dec 5, 2012 at 3:29 PM, David Delbecq <[email protected]>wrote:
Hello,
i have a specific wiki page that is quite slow to render because some groovy code and macros in there are quite slow. Fortunately, content does not change often, si i tried to make it faster for user by using cache rendering.
Here is what is inside my xwiki.cfg:
xwiki.rendering.defaultCacheDuration=3600
And here is my xwiki.properties
core.renderingcache.enabled=true core.renderingcache.documents=wiki:.* core.renderingcache.size=200 # Default value is 300 (5 min). # core.renderingcache.duration=300
I have also this inside my page:
{{velocity}} $context.setCacheDuration(60) //complex content here that has a custom groovy macro and a velocity include {{/velocity}}
{{groovy}} System.out.println("***************************************phone menu not in cache") {{/groovy}}
And i see in my log that, everytime, the System.out is executed, meaning the render cache is not used. What's my configuration problem? What did i miss?
Note: using xwiki 4.1.2 and the url i try is http://server/xwiki/bin/view/MySpace/MyPage?menu=Test.Menu&xpage=plain
Thank you.
David Delbecq
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Rendering cache works well for me.
First of all, not that your are mixing two different features here: what you find in xwiki.cfg and $context.setCacheDuration() are old caching system which is maintained for retro-compatibility reasons only in xwiki/1.0 syntax.
Now about the more generic rendering cache located in xwiki.properties, is your wiki name really "wiki" ? Because here you indicated that you wanted to cache all the pages in the wiki which has "wiki" as identifier. If you are in a single wiki mode (XWiki Enterprise for example) you can simply remove the wiki part as in
core.renderingcache.documents=Space.Page
-- Thomas Mortagne _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (3)
-
David Delbecq -
Marius Dumitru Florea -
Thomas Mortagne