473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dynamic Site Methodology

Say you have a site that queries a database and dynamically generates 1000
pages all linked appropriately. Assume the information in the database is
relatively stable, changing on a weekly basis. I see at least two ways to
accomplish this:

1. Make all the pages php and query and create pages on the fly as needed
by the users.

2. Setup a cron task to call a php script and generate all the html pages
once a day during some low usage period.

Obviously, method 2 much more efficient than running MySQL queries for
each user. That said, I don't see many people doing this. I do realize
that PHP caches are designed to reduce the inefficiencies but why even mess
with them when you can create the entire site in html, via php?

Jul 17 '05 #1
4 1358
On Sun, 29 May 2005 18:05:18 GMT, br***@nospam.com (Bruce) wrote:
1. Make all the pages php and query and create pages on the fly as needed
by the users.

2. Setup a cron task to call a php script and generate all the html pages
once a day during some low usage period.


I do #3:

3. Make all pages php and query and create pages on the fly as needed
but cache the results and display the cached result for all subsequent
users if the content hasn't changed.

The reason for this is that while content can change infrequently it's
also unpredictable about when it does change. With a cron task,
changes to the site are not immediate. Also, most of the pages are
custom to each user in some degree (displaying whether or not they are
logged in) even if the content is static. We also rotate ads which is
another reason for keeping the pages at least partially dynamic.

Jul 17 '05 #2
In comp.lang.php
Wayne <no*@here.com> wrote:
On Sun, 29 May 2005 18:05:18 GMT, br***@nospam.com (Bruce) wrote:
1. Make all the pages php and query and create pages on the fly as needed
by the users.

2. Setup a cron task to call a php script and generate all the html pages
once a day during some low usage period.


I do #3:

3. Make all pages php and query and create pages on the fly as needed
but cache the results and display the cached result for all subsequent
users if the content hasn't changed.

The reason for this is that while content can change infrequently it's
also unpredictable about when it does change. With a cron task,
changes to the site are not immediate. Also, most of the pages are
custom to each user in some degree (displaying whether or not they are
logged in) even if the content is static. We also rotate ads which is
another reason for keeping the pages at least partially dynamic.


So are you using a third party caching program like Zend Accelerator or
doing it yourself?
Jul 17 '05 #3
On Sun, 29 May 2005 19:23:07 GMT, br***@nospam.com (Bruce) wrote:
The reason for this is that while content can change infrequently it's
also unpredictable about when it does change. With a cron task,
changes to the site are not immediate. Also, most of the pages are
custom to each user in some degree (displaying whether or not they are
logged in) even if the content is static. We also rotate ads which is
another reason for keeping the pages at least partially dynamic.


So are you using a third party caching program like Zend Accelerator or
doing it yourself?


Do it myself. I don't think Zend Accelerator actually saves you much
work since you still have to mark off what you need to cache yourself.
I do use Turuk MMcache to do execution caching (Accelerator also does
this) but that doesn't have anything to do with managing content.

I have a framework which makes this all pretty easy to add to an
existing site.

Jul 17 '05 #4
Bruce wrote:
Say you have a site that queries a database and dynamically generates 1000
pages all linked appropriately. Assume the information in the database is
relatively stable, changing on a weekly basis. I see at least two ways to
accomplish this:

<snip>

FWIW, <news:11*********************@z14g2000cwz.googlegr oups.com> or
<http://groups-beta.google.com/group/comp.lang.php/msg/d163108151657c33>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: BillP | last post by:
Hello, I have been in print publishing since the late 1980's, and I need to build several web sites. I am familiar with HTML at a very basic level, and understand its similarities with Quark...
0
by: Jim | last post by:
This si a repost, I apologize but perhaps my original inquiry got buried under all the usenet spam... I need some help getting started with a .NET web project for a commercial site. I am new to...
22
by: Ally | last post by:
Could someone give me an example of a modern development methodology? Just to see if I'm thinking along the right lines... P.S. Sorry for the cross posting but I couldn't find a newsgroup for...
2
by: Dan | last post by:
I have a date field on a C# form I would like to use in the WHERE clause of a SQL statement going against Access2002. Do I need to perform a todate() type funtion on the textbox field on the form?...
1
by: Sunil Menon | last post by:
Dear All, We all always have a problem dynamic controls and ViewState...Suppose we want to create dynamic Controls on Load of the page and Save its value in the ViewState and get them back, will...
10
by: moondaddy | last post by:
I'm writing an ecommerce app in asp.net/vb.net and need to make the pages searchable and crawlable by spiders, particularly Google's. As far as I know, if my pages's contents are mostly populated...
4
by: Robert Camsky | last post by:
Hi, I've got web.sitemap file with few nodes and subnodes and SiteMapPath control. It works fine. But imagine, I'm worrking on an calender implemented this way: calendar.aspx -> showing...
10
by: jflash | last post by:
Hello all, I feel dumb having to ask this question in the first place, but I just can not figure it out. I am wanting to set my site up using dynamic urls (I'm assuming that's what they're...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.