[thelist] [ASP] templating system woe's

Wade Armstrong wade_lists at runstrong.com
Thu Aug 21 13:21:14 CDT 2003


on 8/21/03 7:29 AM, Stephen Caudill at SCaudill at municode.com wrote:

> Joshua Olson on Thursday, August 21, 2003 8:25 AM said:
> 
> : ----- Original Message -----
> : From: "Stephen Caudill" <SCaudill at municode.com>
> : Sent: Wednesday, August 20, 2003 6:12 PM
> : 
> :: I've been kicking myself over it all afternoon.  The only
> :: thing that has occurred to me is to write the contents of the
> :: <body> to a temp file and server.execute that into place in the
> :: template, but that seems very inelegant and likely to add too
> :: much overhead to the processing (there's already a ton of FSO
> :: and RegExp...)
> : 
> : Not too bad of a solution given the scenario.  In regards to
> : overhead, do think about how much traffic the site is likely to
> : generate before getting too worried.  One nice benefit to this
> : method is that you could concievable cache the pages to disk and
> : only overwrite them if the database record is updated. Comparing
> : the datestamp of the record against the datestamp of the file
> : should give you this info.
> 
> This is a rewrite of the templating engine currently in place for
> http://www.municode.com/ which receives around 10k visitors a day
> give or take a couple grand... so the overhead is definitely an
> issue.  I hadn't thought about caching the pages to disk, though.
> Nor do I have any experience with it.  Seems viable, but still
> invokes a strond sense of "wrongness".

Not necessarily "wrong" at all -- in fact, it can be very fast! If, each
time the <body> is updated, you write that to a file using the FSO and then
Server.Execute that, it'll be pretty darned fast, actually - much faster
than querying a database for each time the page is viewed. This particularly
works great if there's a large number of page views for each page update, as
there are on most public sites; it works less well for pages that are often
updated, like in a Wiki, because using the FSO is a pretty expensive
operation.



More information about the thelist mailing list