coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: capecodgal on April 06, 2008, 05:00:39 AM

Title: viewLastUpdatedAlbumsFrom producing delay when loading
Post by: capecodgal on April 06, 2008, 05:00:39 AM
I am not sure if this is an issue with my server handling the request or the script itself.

Example: www.hayden-collective.net (http://hayden-collective.net)
(part that says Last Photo Updates in the sidebar about halfway down)
Gallery Link:  www.hayden-collective.net/gallery (http://hayden-collective.net/gallery)


Code used is in an iframe called through wordpress:


$options = array('windowtarget' => '_blank',"imagewidth"=>"80");
$objCpm->cpm_viewLastUpdatedAlbumsFrom("cat=66,67,17,75,115,116,112,72,113,68,119,104,111:album=0",2,3,$options);
$objCpm->cpm_close();



As you can see it seems to take quite a while to load (about 20-30 seconds) due to that one fetch being called... before adding that one I used just the viewLastAddedMedia and it loaded much faster then this even wit the Random and RandomMostViewed calling many more categories than this one instance. At first I had used many more categories on this one as well and was having issues with the server timing out on the request so I dropped it to less than 15 categories and its at least loading now but seems terribly slow. My gallery has almost 25,000 images and over 100 categories. Could this be an issue with my server handling that request or would it possibly be something in the script itself? Only reason I think that is because the other calls are using many more categories (about 50) and it loaded fine before adding the AlbumsFrom function

Thanks for any direction you can offer-

Title: Re: viewLastUpdatedAlbumsFrom producing delay when loading
Post by: capecodgal on April 06, 2008, 07:52:37 PM
One more thing I'll add; I thought maybe there could be something else in the page causing the delay so I tried just loading the php file with the code and its the same exact thing:

Link: http://hayden-collective.net/wp-content/themes/hc_am2m/latest_albums.php (http://hayden-collective.net/wp-content/themes/hc_am2m/latest_albums.php)

Code:


$options = array('windowtarget' => '_blank',"imagewidth"=>"80");
$objCpm->cpm_viewLastUpdatedAlbumsFrom("cat=66,67,17,75,115,116,112,72,113,68,119,104,111:album=0",2,3,$options);
$objCpm->cpm_close();





Now look at how fast the Random Photos loads and this is calling more categories than the first script:

Link:
http://hayden-collective.net/wp-content/themes/hc_am2m/randm_photos.php (http://hayden-collective.net/wp-content/themes/hc_am2m/random_photos.php)

Code:


$objCpm->cpm_setfilter($filter = ".jpg");
$options = array('windowtarget' => '_blank',"imagewidth"=>"80");
$objCpm->cpm_viewRandomMediaFrom("cat=2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60:album=0",2,3,$options,$filter);
$objCpm->cpm_close();
Title: Re: viewLastUpdatedAlbumsFrom producing delay when loading
Post by: Nibbler on April 06, 2008, 08:46:52 PM
Calculating the last updated albums is a difficult sql query - it takes time with lots of data.
Title: Re: viewLastUpdatedAlbumsFrom producing delay when loading
Post by: capecodgal on April 07, 2008, 02:49:08 AM
gotcha I was thinking it had to be something along those lines but wanted to be sure I wasn't missing anything

I'll just use LadtAddedMedia on this site and I can use the UpdatedAlbumsFrom on other sites with smaller galleries; this is my largest gallery don't know why I felt the need to try it out there first...

Thanks!