p-hu
We are using the very good indexmenu for showing a navigation in the sidebar of our wiki. This works quite fine (after finding the correct configuration). However we are facing the following problem. When I use the ~~NOCACHE~~ the tree needs quite a long time to load (there is also some load on the server side). If I do not use the cache directive the response time is much better, however new pages/namespaces are only shown after the next time the cache for the sidebar page has expired. This is confusing for our users, as new pages/namespaces are not directly shown when created.
So either the tree/menu is slow or not recent. Is there a way to configure the side bar page to expire when either a new page is created or a namespace is added? This would be the right place to recreate the indexmenu page. Maybe it is also possible to recreate the page when something in the wiki is changed. In this case we would have a slow render for editors and faster for view only users.
Can anyone give me a hint how to configure/implement this behaviour?
Thanks
Philipp
lupo49
You could hook in the event IO_NAMESPACE_CREATED and IO_WIKIPAGE_WRITE. When the events take place you have to set the cache validity of your sidebar to an invalid value. Next time you browse the menu, it will be re-generated.
p-hu
As a short workaroung I tried implementing a button for reloading the indexmenu by trying to purge the cache. For this I added a button to my template with the following code:
tpl_link(wl($ID, array("purge" => "1")), "Purge Cache", 'title="Purge Cache" class="action cache" rel="nofollow"');
The link works and results in
http://url/doku.php?id=group:user:sidebar&purge=1
However the cache is not cleared. Am I missing something? group:user:sidebar ist the actual page of the indexmenu sidebar.
Philipp
samuele
You should not need to manual purge cache, indexmenu already take care of this.
If it does not work as expected, it could need to optimize the ACL cache setting according to your site ACLs:
http://www.dokuwiki.org/plugin:indexmenu#acl_cache
For sites with many pages you may want to use the ajax mechanism, for example with max#1#2 option. Note that in this case, the node lists retrieved with ajax after the first level are not cached.
p-hu
Thanks for your answer. However this is not what I observer. The ACL is set no none, as our users can have access to all pages. We do not care about ACL (only for the user private pages). Neverthenless the tree does not reflext changes. I can add a new page or namespace and it is not shown until the cache is updated. Therefore I tried to implement the purge functionality. If I use the NOCACHE directive, the tree works as expected, but it is rather slow and the load on the server quite high.
samuele
To be sure it's not an Acl issue, could you test that the ACL cache set to "User" does not affect this bug?
Please also report:
1) The Dokuwiki version
2) The indexmenu versione
3) The list of your installed plugins
Thanks,
Samuele
p-hu
I tried setting the ACL cache to "User" -> no change. New pages/namespaces are still not shown.
The versions:
1. Dokuwiki -> Rincewind
2. Indexmenu -> current dev version, had a problem with the release version. I also tried again the release version. Same problem.
3. Plugins
Acronym Plugin
Changes Plugin
fckg_specials
include plugin
Indexmenu
Info Plugin
Pagelist Plugin
PageQuery Plugin
Table Width Plugin
Wrap Plugin
samuele
I can't reproduce it in the 2011-05-25 release.
Is the indexmenu declared inside a wiki page or is called in another way? What's your theme?
p-hu
My theme is arctic-mbo and the index menu is called insede the root->group->user page of the wiki in the side navigation. I have two side navigations (based on the theme template). One is the man navigation which is a hand made list of links. The second below ist the namespace navigation. This is where I use the indexmenu with the following command:
{{indexmenu>..#2 wiki#0 administration#0|js#tango.png navbar msort tsort nsort notoc id#random}}
There is also anothe issue, where I cannot tell the indexmenu to keep some of the namespace levels closed when initially loading.
http://forum.dokuwiki.org/thread/7507
Somehow it seems to be related to the place where I load the index menu. When I put the same command in a normal page, then the tree seems to be updated as expected. However this is not the case when I put it in the group sidebar of the arctic-mbo theme.
p-hu
I had one more test and exchanged the two side bars. I put the indexmenu in the main sidebar. However the tree is not updated as expected.
p-hu
I tried to find out some more. As stated above I'm using the arctic template with a sidebar on the left side showing the index menu. I'm not a real PHP programer, but I added some debug code in action.php->_purgecache. From what I see the code below
if (!p_get_metadata($ID, 'indexmenu')) return;
is only executed, when I directly access the sidebar page, but not if I just reload the normal wiki page with the sidebar. I did not try to understand the strcture of the cache so far, but in case of a theme having sidebars, is there some metadata about the indexmenu?
Sorry, if I'm not clear. We really would like to use the indexmenu for the navigation. But it is not updated when pages/namespaces are added. So this is not working for us.
Can someone give me some hints if I'm looking at the right place and where I could get some more input on how a page in the arctic template is rendered?
I also tried with the default template and from my point of view the tree is not updated (even without sidebar).
samuele
To correctly work, indexmenu needs to be declared inside a dokuwiki page and the theme has to load that page (in the sidebar) using the Dokuwiki API for render pages (p_render()).
This ensures that Dokuwiki page triggers (in this case the cache mechanism) are correctly executed.
Please, try the original arctic theme in you site. If it works then you need to change the way your current theme renders indexmenu.
p-hu
On a test installation I used the original arctic theme and I am observing the same problem. Newly added pages and namespaces are not shown in the indexmenu. When the cache expired or I touch local.php and then reload the page, the new nodes are shown.
I checked the code. Both templates (arctic and arctic_mod) use p_wiki_xhtml (which later uses p_render) to render the sidebar content. So cache handling should be working.
To be honest, I'm lost. Is there a dokuwiki installation with sidebar where this is working? Is there any setting which could influence this, which is maybe set wrong on my installation?
p-hu
I think I found the problem. ON the test installation I removed all plugins and then the tree was updated correctly. I added the plugins on by on and in this way identified the plugin changes and include as possible couses. I can not tell which of the three plugins does not behave correctly. However when I remove the above two plugins indexmenu works correctly.
Now where to go from here? As stated I am no real PHP programer. I'm not sure if indexmenu does not correctly define dependencies (my guess) or one of the other plugins overwrites something. I see that all this plugins register a handler for the PARSER_CACHE_USE event. I suppose ther somehow is the problem.
Can someone give me a hand on this?
lupo49
Does both of them (in combination) cause the described behavior?
p-hu
If one of them or both are present, then the tree is no longer updated.
samuele
Does the page containing the indexmenu syntax also contain the syntax of those plugins?
If yes, removing their declaration and leave only the indexmenu one works as you need?
p-hu
No the sidebar does not contain any other syntax just the call to the indexmenu. Actually the other two plugin are only used on some other pages (changes on 1 page, and include on about two - for now). I may be able to remove this syntax and then delete the two plugins. But somehow it does not give me a good feeling. I'd rather know why the indexmenu is no longer working, when the changes/include plugin are present. Else the next time I use another plugin again the indexmenu stops working. As our content ist organized in logical namespaces, the indexmenu is really very helpful as main navigation.
samwilson
I was having this same issue, and solved it by putting ~~NOCACHE~~ in the sidebar. Not the best solution, because it slows things down, but it'll do for now I suppose.
p-hu
You are right, when using the ~~NOCACHE~~ directive, the tree is update. However this is not working for us. It gets to slow and also the load on the server is rather big. I tried using the ajax solution, but to be honest, the usage of the tree gets much less intuitive. For the moment I will stop using the two plugins which affect the caching. Hopefully there will be some other solution. I may also try having a look at the code ... but this include understending the internas of the cache handling ... I was planning to use dokuwiki and not to do some extensive coding.
Can someone give me a hint on where to find some documentation on the interna of dokuwiki (example: strukture of the cache, meta information, event handling)?