My gallery currently get a lot of hits, I have turned on the static_html_cache plugin which managed to cut the CPU load quite a bit. Unfortunately it did not do enough, I often post links directly to Zenphoto search results, which makes things easier for users, but flogs the webserver as the pages needs to be created dynamically every time it is viewed.
I have tweaked the static_html_cache plugin so it works for my needs, it looks at the date or words being search for, and uniquely caches the results page as HTML. It handles pagnation, but does not support varied search fields (as I don't give people the option of changing them).
The diff is as follows:
$cachesubfolders = array("index", "albums","images","pages");
73c73
< setOptionDefault('static_cache_excludedpages', 'contact.php/,register.php/');
setOptionDefault('static_cache_excludedpages', 'search.php/,contact.php/,register.php/');253,266d252
< // search.php
< if($_zp_gallery_page === "search.php") {
< $cachesubfolder = "search";
< $custompage = $_zp_gallery_page;
< $words = $_REQUEST['words'];
< $date = $_REQUEST['date'];
< if (strlen($words) > 0) {
< $custompage = $words."-".$custompage;
< }
< if (strlen($date) > 0) {
< $custompage = "d".$date."-".$custompage;
< }
< $cachefilepath = $cachesubfolder."/".$custompage.$page.$locale.".html";
< }
268c254
< else if(isset($_GET['p'])) {
if(isset($_GET['p'])) {299c285
< $cachesubfolders = array("index", "albums","images","pages","search");
$cachesubfolders = array("index", "albums","images","pages");