keeping less then 10 old page versions for faster page loading

Is there a way to change the number of versions wich will not be deleted when running the remove old page versions optimization job ?

By default it is 10, but i like to limit this to 3 only, so my pages will load faster

View Replies:
frz replied on at Permalink Reply
this really shouldn't make your pages load faster. At most this should
make you're editing experience faster.

That being said, I'm sure if you dig around in the script that job is
running you can probably tweak it to do that. It's open source! :)

best wishes

Franz Maruna
robgevers replied on at Permalink Reply
Hi Franz,

it looks like the job contains an bug??

on line 37 : $pages = $pl->getPage($pNum); This will return one page only.

so the foreach on line 46 only goes over 1 page every time this job gets runned. Or am i missing something somehwere

That explained why my home page had 200+ versions.....

also not sure about $pl->setItemsPerPage(3); on line 31
robgevers replied on at Permalink Reply
it is not really a bug, but it will only do 1 page per run. I run the script 1 x a day.....but with 100+ pages, this is not very efficient.....
firestorm0001 replied on at Permalink Reply
This is wholly untrue. I have a *SERVER* that was taken offline today due to excessive versioning coupled with a DOS attack against the site itself. (I host more than 60 concrete sites on the same server). During my investigation, I found the following query that was showing up in my mysql slow logs:

# Query_time: 0  Lock_time: 0  Rows_sent: 0  Rows_examined: 31021
SELECT cID, cvID, arHandle FROM CollectionVersionBlocks WHERE bID in (select bID from btCoreScrapbookDisplay where bOriginalID = '195');

This query is exceedingly bad due to the subquery and really should be written as:

SELECT cID, cvID, arHandle FROM CollectionVersionBlocks AS c
    SELECT bID FROM btCoreScrapbookDisplay WHERE bOriginalID = '195');
) AS bt ON bt.bID = c.bOriginalId
guythomas replied on at Permalink Reply
Copy the /concrete/jobs/remove_old_page_versions.php file into the /jobs/ directory to create a local override.

Open the new file and change line 53 and 55. Just substitute the number of versions you want to keep in place of the 10 that is there.

That should be it.

robgevers replied on at Permalink Reply
Thank you very much !
serdica replied on at Permalink Reply
I'm using the latest build ( and "remove_old_page_versions.php"
in "concrete/jobs" is just 3 lines:
defined('C5_EXECUTE') or die("Access Denied.");
class RemoveOldPageVersions extends Concrete5_Job_RemoveOldPageVersions {

I was able to find the file that you were probably referring to in "concrete/core/jobs". But then when I create "remove_old_page_versions.php" in "jobs" with the following content:

class RemoveOldPageVersions extends Concrete5_Job_RemoveOldPageVersions {
  public function getJobDescription() {
    return t("Removes all except the 5 most recent page versions for each page.");

and this does not seem to influence the text displayed in Dashboard > System&Settings > Automated Jobs...

Any ideas how to proceed with the override?
ryan replied on at Permalink Reply
Another way to help this job catch up is to create a separate cron job that runs hourly instead of daily and calls this job specifically.
ryan replied on at Permalink Reply
I just took a look at the code and verified it works as described in the documentation here: