Dynamic Site Methodology

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruce

    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?

  • Wayne

    #2
    Re: Dynamic Site Methodology

    On Sun, 29 May 2005 18:05:18 GMT, bruce@nospam.co m (Bruce) wrote:
    [color=blue]
    >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.[/color]

    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.

    Comment

    • Bruce

      #3
      Re: Dynamic Site Methodology

      In comp.lang.php
      Wayne <not@here.com > wrote:
      [color=blue]
      >On Sun, 29 May 2005 18:05:18 GMT, bruce@nospam.co m (Bruce) wrote:
      >[color=green]
      >>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.[/color]
      >
      >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.[/color]

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


      Comment

      • Wayne

        #4
        Re: Dynamic Site Methodology

        On Sun, 29 May 2005 19:23:07 GMT, bruce@nospam.co m (Bruce) wrote:
        [color=blue][color=green]
        >>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.[/color]
        >
        >So are you using a third party caching program like Zend Accelerator or
        >doing it yourself?[/color]

        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.

        Comment

        • R. Rajesh Jeba Anbiah

          #5
          Re: Dynamic Site Methodology

          Bruce wrote:[color=blue]
          > 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:[/color]
          <snip>

          FWIW, <news:111143049 5.275366.42540@ z14g2000cwz.goo glegroups.com> or
          <http://groups-beta.google.com/group/comp.lang.php/msg/d163108151657c3 3>

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

          Comment

          Working...