forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: itang on June 17, 2006, 04:42:50 pm

Title: Reduce loading time of index.php
Post by: itang on June 17, 2006, 04:42:50 pm
I have a gallery with 400,000 pictures and 8000+ members, it takes a long time (10s+) to load the index.php.

Everytime when members login, logout, upload, create albums... they fallback to index.php. It not only takes a long time but also make a huge demand on sql server.

Is it anyway to make a very light index.php? I only need login/out, my album link in the index page.

Thanks everybody!
Title: Re: Reduce loading time of index.php
Post by: Sami on June 17, 2006, 11:46:36 pm
as described before you can disable "Random Pics" on your index.php to reduce CPU load (MySQL Load)also you can remove some un wanted block from index by going:
admin mode=>config=>Album list view=>The content of the main page
for more info read docs (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_album_list)
Title: Re: Reduce loading time of index.php
Post by: itang on June 18, 2006, 04:38:18 am
Thanks for your reply. I have already disable all blocks except ablist for the index page. It still takes a long time to load the page.

I am thinking of making a brand new index.php with only login / logout (which can show the name of user if one login) and my albums (which link directly to member album).

Anyone can help me if i want to include these two function into a page?

Thanks a lot!
Title: Re: Reduce loading time of index.php
Post by: Paver on June 18, 2006, 04:57:26 am
Put what you want into anycontent.php, then put only 'anycontent' in the "content of the main page".

Here's a simple login box I have in anycontent:
Code: [Select]
<?php
if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

if (!
USER_ID) {
starttable("100%""Welcome");

?>

<tr><td class="tableb" >
<form method="post" name="loginbox" action="login.php?referer=index.php">
<p class="MsoNormal" align="left">
Username: <input class="textinput" name="username" style="width: 65;height:17" tabindex="1" type="text">
Password: <input class="textinput" name="password" style="width: 79;height:17" tabindex="2" type="password">
<input name="submitted" class="button" value="Login" tabindex="4" type="submit">
</form>
</td></tr>
<?php
endtable();
}

?>

It's simple because I use that above the rest of the "content of the main page".  You might want to add a register and forgot password link.  You can check Coppermine's login.php for that.  And for the "My Gallery" link, format the HTML however you like and then add the appropriate link.

Otherwise, there have been other threads that discuss creating cached snapshots of certain pages and blocks for high-traffic sites like yours.  I don't think anyone implemented such a thing, but I might be wrong.  It would take some work to do this, but it shouldn't be that difficult.

Maybe your simple index page will do the trick.
Title: Re: Reduce loading time of index.php
Post by: Stramm on June 18, 2006, 09:36:56 am
the two thingies on the index that burn most resources are the random block and the statistics. I've written a solution on how to speed up the statistics. You can check the code in the modpack. Or you can just disable statistics. On huge gallery this gives serious improvement. Deleting the menu and stuff... not worth the effort
(I'm talking about the '2949 files in 120 albums and 11 categories with...')


Also having as less as possible categories on the index helps.
You can disable category stats as well (the numbers next to the categories)

This needs code modification