00544: Limit the number of displayed diffs at once (was: Caching for history)

Summary: Limit the number of displayed diffs at once (was: Caching for history)
Created: 2005-09-28 04:14
Status: Closed - cookbook recipe
Category: CoreCandidate
From: opitzs
Priority: 5531
Version: 2.1.3 - 2.1.5

Description: A page history can become quite big, as seen on pmwiki.org. When you then take a look at the history, it takes quite some time. Is there a possibility to cache the prior history and just add the new items to it? Of course this should be optional behaviour and is really low priority. But I guess it could speed up the build process drastically.

This is what PmWiki currently does -- it simply adds new items to the existing history.

The reason that the history takes a long time to display seems to be due to the way that browsers render the boxes in page -- for example, the page history is very fast for me with Firefox for Windows, but seems to take a very long time to display in Firefox for Linux. I haven't had a good opportunity to find out why the Linux version takes so much longer.

What browser are you using?


I use Firefox 1.0.7 on windows and the same on linux, but couldn"t find a difference in speed.


Maybe we can just introduce two additional parameters to choose what to show.


to show entry 1 to 20. If such range is shown, we can output a little navigation "previous|next". I think this would solve the most problems.

Another nice improvement would be to show a single "lined changed from-to" entry side by side and not under each other.

Schlaefer November 28, 2005, at 04:52 AM

See the bottom line.

Sample solution

I also support this request. Especially usefull on big pages with long history subject to vandalism. Here is what I did:


This file is a slightly modified version of scripts/pagerev.php : to test it, backup the original and rename this one to "pagerev.php".

There is a new variable "$DiffCountPerPage", default 0 and may be changed in config.php. If it is 0, nothing changes, the history is displayed like it is now. If you set i.e.

 $DiffCountPerPage = 4;

the "diff" action will display only 4 changes, and links to more ancient and more recent changes. It will also display a link to show all history in one page. Petko

(Surprisingly, one can overwrite my uploaded file: here is a copy. --Petko

I just found this using gmane. Thanks. It is something I really needed.


The patched file was submitted in March 2006, and as of pmwiki-2.2.0-beta64 (2007-11-13) it is still up-to-date and working (the original file scripts/pagerev.php did not change since). --Petko


I have just converted this patched version into a standalone recipe. See Cookbook.Limit diffs per page. --Petko November 14, 2007, at 10:49 PM