My PHP site takes 10 secs to load the first page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
guarriman
Forum Commoner
Posts: 44
Joined: Thu Nov 03, 2005 4:11 am

My PHP site takes 10 secs to load the first page

Post by guarriman »

Hi.

Working with PHP5, I'm suffering an odd issue with the load of my website, which is an application allowing users to register and to post question in a kind of forum/bboard.

It's made with some PHP classes I created (they write/read to/from mySQL tables), and uses Smarty.

But the first time one user access any webpage, it takes 5-10 seconds to load. Then the rest of pages visited by the same user go really fast, so I'm wondering what's wrong with my PHP app.

Do you have similar experiences? I'm considering:

- Smarty takes some seconds to compile
- App takes some second to handle session variables (I use a lot of them)

Any suggestion is welcome. Thank you very much,
--mark
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: My PHP site takes 10 secs to load the first page

Post by pickle »

Hard to say - look into microtime() & how it can be used to time your page. Time the different sections of your page to see what's taking the time.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply