lupo49/dokuwiki-plugin-orphanswanted

Caching issue

egon1024 opened this issue · 4 comments

Hey - I have a bit of a weird issue with the plugin that looks like a caching problem, but I haven't been able to figure it out.

Some background: I have a dokuwiki instance that's somewhat decently sized - a bit more than 5600 pages, last time I looked. The thing that brought me to use the orphanswanted plugin (which has been SUCH a big help - thank you for writing it! :) ) is that, by the nature of the wiki I work on, has a lot of links to pages that have not yet been authored. Some of these pages may only have a single link to them, others might have 100+

I have a very simple page in the wiki (located at pages/wiki/broken.txt on disk) for displaying these links. The entirety of the page is:

====== Broken Links ======

~~NOCACHE~~
~~ORPHANSWANTED:wanted~~

That's it.

Recently (past month or two, perhaps?) it seems that reloading the page (even using "shift reload") does not update the data on the page, and I'm a bit confused why. If I had been making use of a link that was (for example) [[a:b:c]] it shows up on the list just fine. However, if I create the page for a:b:c, it doesn't get removed from the list. The link on the page still shows up in the list, and is red (my broken link color). Clicking on it brings me to the page itself. I've tried loading the pages in other browsers, and even on other computers to make sure it wasn't a client side caching issue.

The thing that makes me think this must be a caching issue is execution time. Previously, generating the page took significant time (I'm guessing because it has to render every page in the wiki to determine which links are broken). It would often take 60-90 seconds. Now, the page comes up very quickly - less than a second until it's rendered.

An additional data point. If I take a look at one of the links rendered in the table, and add it explicitly to the page (for example, simply adding [[a:b:c|a:b:c]] to the page), that link does show up (indicating the whole page isn't cached) and the link is green (my "happy link" color).

I don't suppose you might have any thoughts about wth I'm doing wrong? 😆 This used to work fine, and I'm not consciously aware of doing anything, though I did recently update to the latest version of the plugin ...

Thanks in advance for any help, and if I can do something to help debug (add lines of code to the plugin, etc), I'm knowledgeable enough to do so (though I don't know PHP very well, having not used it since version 4).

With the latest release 2023-05-30, we switched to the internal indexer of DokuWiki for the best link detection and best performance.

Before, we looked through every page which would explain the long execution time.
Now, the link list is provided by DokuWiki.

If the page includes ~~NOCACHE~~ (disables DokuWiki cache) and "shift reload" (disables browser cache) doesn't work, it's most likely that the DokuWiki indexer hasn't caught up.
Maaaaaayyybe (I think it's unlikely), there's another cache (e.g. nginx as a reverse proxy).

Ok - from a technical perspective that's quite interesting. Thanks for the explanation.

Here's the odd thing though. If I take one of these links that is showing up in the list and explicitly add it to the page, the link is showing up as green. Would that not indicate that the dokuwiki indexer is aware of it? Also, one of the pages that is showing up as "missing" has been in place for several months now - it seems surprising to me that that would happen. 🤔

Is there a way I can get the dokuwiki indexer to "refresh"?

Yes, you can rebuild the cache. At least I'm 95% certain that this also rebuilds/updates the index which is used by orphanswanted... no guarantees.

https://domain.example/start?do=admin&page=searchindex

You were spot on - running the indexer manually from the cli (with the -c option to make sure to clear it out first) did the trick. Thanks for the help! :)