Caching in the Application Object

D

dave

There seems to be plenty of discussion about caching in the Application
Object, however, I cant find any info on what realistic limitations there
are and how they are measured

What are the factors that will limit performance / storage of many
individual or single large bits of data with application scope?

eg database driven list boxes (that dont require up to the minute data)
10 * 100 options? 100 * 100 options? kb's? megs of info? How much can I
cache? :)

Cheers
 
E

Egbert Nierop \(MVP for IIS\)

dave said:
There seems to be plenty of discussion about caching in the Application
Object, however, I cant find any info on what realistic limitations there
are and how they are measured

What are the factors that will limit performance / storage of many
individual or single large bits of data with application scope?

-if- you store objects in the application you should use components without
thread affinity (so no VB6!) or a badly compiled C++ component.
Second, read performance from normal data such as strings and arrays is OK.
But as soon as you start writing to it, you need to lock. So, data that not
so often changes is OK. The limit is the sky, so for readonly data.
eg database driven list boxes (that dont require up to the minute data)
10 * 100 options? 100 * 100 options? kb's? megs of info? How much can I
cache? :)

No hard numbers. Readonly data is OK.
 
D

dave

Yes, for arrays/strings/text only.
So - really nothing to worry about then? sweeet....
(Not that Im going to slap my whole website into the application object or
anything silly... ;-)
 
D

dlbjr

Dave,

How I would do this:

To fill the data into an Application Variable.
Read the data from the database into a record set and save to an XML STREAM into your Application
Variable
And store the date stamp when you done it into a Application Variable. This will allow age
management of the data.
When needed to build a drop down or list, then just load the XML STREAM into a recordset and
process. This will run fast and allow you to maintain state of the selected item per client if
needed.

HTH

dlbjr
Pleading sagacious indoctrination!
 
D

dlbjr

<%
'Most of my code is object based and I will not release needed objects to the news group.
'The code below should give the Idea. If you do not need to maintain state the build the
'dropdown output and store it in the Application variable instead of the XML.This will allow
'you to place the dropdown in code at any time.


'Once you have loaded your data into a record set then pass to this function
'This will load the Application Variable with an XML String. This can be done
'in your global.asa file.
Serialize rs,"AppVarName"

'You can use the code below to load a recordset on any page.
rs.Open Deserialize(Application("AppVarName"))
'Build drop done from loaded rs.
%>


<script language="vbscript" runat="server">
Public Sub Serialize(recordset,strAppVarName)
Set mxmldom = CreateObject("MSXML2.DOMDocument")
recordset.Save mxmldom, 1
Application.Lock
Application(strAppVarName) = mxmldom.xml
Application.UnLock
Set mxmldom = Nothing
End Sub

Public Function Deserialize(strAppVarName)
Set mxmldom = CreateObject("MSXML2.DOMDocument")
mxmldom.loadXML Application(strAppVarName)
Deserialize = mxmldom
Set mxmldom = Nothing
End Function
</script>


'dlbjr
'Pleading sagacious indoctrination!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,367
Latest member
Monarch

Latest Threads

Top