Reply to Re: Why not generate static pages instead of dynamic?

Your name:

Reply:


Posted by Moot on 10/16/06 20:54

pittendrigh wrote:
> There must be millions of dynamically generated
> html pages out there now, built by on-the-fly php code
> (and jsp, perl cgi, asp, etc).
>
> Programatic page generation is transparently useful.
> But querying a database, negotiatinig lots of if-then-else logic
> and echo'ing html code out on port 80 every time a
> page is requested has to be a huge waste of resources.
>
> Why not use that logic to print static html instead of dynamic?
> The few pages that need to be dynamic (perhaps the results of a
> database
> query) probably represent only a small fraction of the total
> number of pages that are rendered by on the fly code.
>
> Seems to make sense to me. All you need to do is work
> the output directories into your code logic somehow,
> and do a few one-time-only mkdirs before printing out the static html.
>
> Am I missing something?
> Why is it so little open source page generation software acually
> works that way?

If I recall correctly, Smarty does something similar with it's caching.
Once a page is generated, it can be cached for a period of time so
that subsequent requests don't load the acutal page, but a static
version.

I see what you're trying to say, but don't agree with your assertion
that only a small fraction of pages need to be truly dynamic. Sure,
things like blogs or community webpages (or any page that only gets
updated once per day or slower) could benefit from serving static pages
and regenerating them at periodic intervals, but many web apps *need*
to be dynamically served at each page request. 90% of the pages in the
app I develop for need to show up-to-the-minute information from when
the page loads.

I haven't done the performance tests to see how serving up a cached
Smarty page vs a dynamically generated page compares, but I would guess
that the benefits are trivial to most people. If you're dealing with
traffic on the yahoo/ebay/google scale, then maybe that tiny boost
could mean hundreds of thousands of dollars in savings, but for most
people I don't think it really matters that much.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация