Slow page load with many categories

Date added: 09 February 2012 Last revised: 09 February 2012 Hits:

This information applies to DOCman 1.5.x.

If you have a lot of categories (+500), loading some pages in the frontend can become rather slow. You can fix this using a small hack in the code. Edit this file:

DOCMAN_model.class.php

Find this line:

$this->objFormatData->files = DOCMAN_Cats::countDocsInCatByUser($objDBCat->id, $user, true);

Replace with:

$this->objFormatData->files = 0;

This change prevent DOCman from counting all the documents in the category and it's subcategories. All categories will be reported as having 0 files.