Forum Moderators: coopster

Message Too Old, No Replies

page processing time

         

sssweb

2:42 pm on Nov 12, 2011 (gmt 0)

10+ Year Member



I have a page that uses include() statements to include a long series of text files; my question concerns processing time. The page file itself is small, say 1kb. The included text files are large, totalling say, 100kb.

Since the page file itself is only 1k, I know a server loads it fast. I also know that php processes the include script fast (I ran a microtime() test on it: .1 sec).

Does this mean that the whole page, with all the included text, displays to the user in about .1 seconds? Or does the server still need time to load the 100k text (say 5 secs on a dial-up connection).

Seems like it should; is this how it works?:
1) source page loads (.001 sec)
2) php processing (+ .1 sec)
3) server request (+ 5 sec)
Total: 5.101 seconds

I don't have a dial-up connection, so I can't do a real-time test, and various web-based tests give conflicting results.

sssweb

1:37 pm on Nov 13, 2011 (gmt 0)

10+ Year Member



I found a work-around for this.

penders

6:50 pm on Nov 13, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A work-around?

There are a few things that affect the time it takes for the end user to get the finished HTML page:

- Server receives request...
- The time it takes PHP to build the HTML page... source page + includes + processing
- Resulting HTML response sent to client (100KB+) - depends on users connection (not the server).
- Any additional HTTP requests for external scripts, stylesheets and images. (users connection/browser + servers ability to handle requests.)

As far as the server goes, 100KB is not particularly big for an include. However, if this is largely HTML which you are embedding directly in the page then yes, it is quite large. (Having said that, the size of most web pages these days is enormous by comparison.) For instance, the project I'm currently working on has about 60 'includes' totalling about 600KB, but the resulting HTML page that is sent to the client is only about 18KB (uncompressed) on average.

Some browser extensions like Firebug + YSlow will give a good indication where the bottle necks are with slow loading pages.