[thelist] Application variables vs reading flat files

Warden, Matt mwarden at mattwarden.com
Mon Aug 6 11:08:43 CDT 2001


On Aug 6, Scott Dexter had something to say about RE: [thelist] Application...

>> in memory (they aren't huge, maybe 5-10k).  Would I be right in this
>> assumption, are application variables the way forward for me?
>> 
>
>It sounds reasonable to me. What you could do is in your global.asa read
>in the templates from your flat files into the Application vars and use
>em from there. The downside depends on how often the templates change,
>because it will require restarting the website (so the
>Application_onStart fires again to load the templates)

Not if you don't reply on Appplication_OnStart  =)


How's about something like dis:


sPageContent = trim(Application("thispage"))
if sPageContent="" then
	    'FillAppVarAndDisplay(appvarname, contentFile)
	call FillAppVarAndDisplay("thispage", "thispage.inc")
else
	Response.Write sPageContent
end if


You could couple that with setting this page up as your 404 document,
forcing a 404 on pages, then parsing the URL for the application variable
name, making this a general script and your site really running off of one
script (plus the content files). So you'd have URLs like:


mydomain.com/foo/thispage/other/vars



The benefit of the above solution is that you can set
Application("thispage")="" at any time, which will trigger a re-reading of
thispage.inc into Application("thispage").

More info:
http://www.evolt.org/article/view/17/621/index.html


hth,



--
mattwarden
mattwarden.com





More information about the thelist mailing list