|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
At what point does dynamic content become detrimental?
First, if this is the wrong place to post this topic, please let me know and I will move it to the appropriate area. I think I originally posted it in the wrong area.
Ok, I am new to this dynamic webpage stuff but I think I am getting the hang of it. I am in the process of changing my website from a set of table/div driven static pages to a collection of php driven dynamic pages and I need some input. Basically I am trying to figure out at what point does dynamic content become detrimental. For instance, if I have one template file that references a bunch of files to build the page, at some point this could become a burden. If I have a file that contains all the content of the website, delimited in some fashion for searching, I would think that as the file gets larger it may be more efficient to just call a separate web page with static content. Here is what I have so far. My first cut at the work had me create a “template” page that had php includes for the header, footer, sidebar menus, and a subheader. Then each content area would be on its own page with all of the template items. This is a start, but I would still need some 50 or so pages, and if I had to change the template I would be up the creek. Next I created a little script that would read a text file to build a dynamic menu. At first I had all the data in one file, then I broke it down into 5 or 6 files. One file for each major section of my web page (About Us, Products, Online Catalog, etc). I figured this would help minimize the time required to build the dynamic content, plus with separate files you can minimize some of the code. So, basically this is what I have now. <include the header> <include the left menu, which is a script that references a set of text files to generate the content> <include content header> <include content> <include right menu> <include footer> Now I think the header, menu and footer includes are the right way to go. My question is the content area. Do I replicate this structure over and over and just have unique content on each page, or do I have the content include reference a script that will read a text file and build the appropriate page. So, as a result my website would consist of one web page, a few programs to build pages and a set of text files used to create the content. Does any of this make sense, or do I need to clear up my thought process. After thinking about it for awhile, maybe I could put all this in a database. That way I could just search one column, then when I find the row I need, write a different column. Does anyone have any general thoughts on the best way to approach this? Thanks...Mike |
|
#2
|
||||
|
||||
|
I meant to move this for you, but got caught up in something else.
The use of dynamic content does increase the server load and page load time. This is the trade-off for easing site maintenance. Any decent server can handle the additional load created by multiple database and file calls caused by using templates. This can be offset with a good template engine (ie, Smarty) that caches parsed template files. Does it sound like I'm flip-flopping a little? It's b/c I am. For most applications, using the basic PHP include() is just fine -- we're talking milliseconds of difference. There are very popular third party scripts that open and read several files per page load, but are still very quick. When you decide to go with a template, whatever you do needs to ease the maintenance process, while including and reading as few files or as little data as possible. If you're including a large file and only using a few lines from it for each different script, then you might think about making several smaller files and only including the one that has what you need.
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#3
|
|||
|
|||
|
Jeremy,
Thanks...Its sounding more and more like black magic. I have even thought of developing a script to build individual "static pages" offline. This way I could still do my updates easily, then once online they would not have too many calls. Mike Last edited by EvM-Mike : March 11th, 2004 at 01:27 PM. Reason: spelling |
|
#4
|
||||
|
||||
|
That's an idea as well. I believe eBay does that for some of it's pages (eg, auction lists, but not auction details).
|
|
#5
|
||||
|
||||
|
Is there any advantage to using PHP for dynamic content over SSI?
__________________
Family Hosting, we treat you like family! United Web Site Award Givers, is your website worthy of an award? |
![]() |
| Viewing: Dev Shed Forums > Web Design > Web Design Help > At what point does dynamic content become detrimental? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|