[thelist] To Application or Not ..

Scott Webster pippen at bigpond.net.au
Tue Jan 21 22:48:00 CST 2003

---- Original Message -----
From: "Michele Foster" <michele at wordpro.on.ca>

: I have "huge" lists on all of my pages.  Currently the data exist in the DB
: but it's a big performance hit to keep grabbing the list data from the DB
: each time it is required.  Sometimes, it's required on more than one page
: (i.e. list of languages (247 of them so far) and a drop down to select Lang1
: and Lang2).
: I see two possible options, and I'm not sure which is best.  I can save the
: data as an Application object or I can write the data to a text file and
: loop through it that way (this is what is being used atm).  I'll need to
: create an Admin form whereby the user can regenerate (or set to null) the
: Application in question or rewrite the text file. Not a problem .. if anyone
: has any clue how (if) I could automate this to run, say every 12 hours on
: its own, that too would be helpful ..  but isn't the reason for my post.
: What's better?  Storing the data as an Application object (is that the right
: term?) or to save it as a text file and use an FSO call to the text file
: whenever the data are required.  The FSO set up currently being used is
: working well.  I'd just like to ensure I'm doing the BEST option. ;)

hi Michelle

I'd think that using the Application object would be better.

I can't remember the actual statistic but I think a web-server consumes
~29K of memory (totally unsubstantiated trivia but you get the idea)
everytime a db connection is made.

Multiply that by x number of users requesting your page, making a connection
to get a list that stored in Application memory might take 2-3k once only.

On the admin page that maintains the list of languages, rebuild the app var
when you modify the list. It might only change every 2 weeks?
Your call on the caching/refresh approach of course...

Have a function, say GetComboOptionString("languages")
that checks if the Application var is built, pulls it from the Application var
exists or builds it, stores it in the app var and returns it otherwise.

works like a charm for me. hope that helps


More information about the thelist mailing list