I've been kind of stress testing 4images, and I've noticed that (with the cache turned on) the mysql query that takes the most time (>70%) is the lines:
$sql = "SELECT cat_id, COUNT(*) AS num_images
FROM ".IMAGES_TABLE."
WHERE image_active = 1
GROUP BY cat_id";
$result = $site_db->query($sql);
from global.php. Is there any way to put the result of this in the cache to speed things up?
I believe the time increases linearly with the number of files. I'm running the mysql under xampps with windows xp and 70,000 files in the database. Category pages show up in 0.7 seconds with cache; this mysql query takes 0.55 seconds.
As a side note, I sped up the details.php page by commenting out the next/prev file section, and use include of global2.php where global2.php has the code above commented out. No the most finesse way, I know. Also, the "show new" feature seems to take a lot of resources, but then all 70,000 files in my test database were new.
So if anyone know how to cache the above code, please post it. Thanks.