On Sat, 3 Dec 2005, Tim wrote:
On Fri, 2005-12-02 at 07:57 -0600, Les Mikesell wrote:
The slowness depends on how your cgi executes. If it is a perl
script loading perl on every hit it will be slower. If you
use php, mod_perl, fastcgi, speedycgi, java, etc. where the
interpreter is loaded once for many hits you won't really see
a speed difference.
As well as how well you write your program... It does seem however,
that nearly every dynamically generated site that I've come across
behaves like it's on a 16 MHz 486.
Don't confuse dynamic with badly written/managed/tuned. Many dynamic sites
use PHP and other scripting languages in very naive ways with the nearly
inevitable result of tanking the backend database under load.
Frequently the people writing the scripts have no formal training in
programming and so have no idea about such basic concepts as caching,
profiling, and big-O analysis.
As far as caching goes, it shouldn't make any difference.
Many things will not cache URIs with parameters.
e.g. <http://example.com/cgi?some+parameters>
In the belief that they might be caching something that they really
shouldn't.
It is more than that. CGI/other scripts freqently fail to implement the
more advanced sections of the HTTP standard that provide guidance on
caching such as Cache-Control, Modified, Expires, Vary, ETag or even plain
old 'HEAD'. In essence, they *TELL* the browsers to not cache by failing
to do so.
Additionally, they often ignore the abilities to pass parameters in more
transparent ways than '?' GET paramters and to cache generated content
on the server when it is not expected to change rather than hitting the
database repeatedly to do *exactly* the same thing over and over.
Take a look at <http://newark.org/>
That site is nearly entirely Java and mod_perl under the hood. With the
exception of images and PDF, almost everything you are seeing is being
generated from a database as needed (with an efficient caching system on
the server).
Does it feel slow to you?
--
Benjamin Franz
The designer of a new kind of system must participate fully in the implementation.
- Donald E. Knuth