Reduce loading time of index.php Reduce loading time of index.php
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Reduce loading time of index.php

Started by itang, June 17, 2006, 04:42:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

itang

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!

Sami

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
‍I don't answer to PM with support question
Please post your issue to related board

itang

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!

Paver

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:
<?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.

Stramm

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