Bruce wrote:
> In a site that has about 4000 products, in 1000 categories, I thought
> that I can store each product and category details in its own
> application("var"), instead of trips to the database.
>
> When someone will go to product.asp?id=123, the page will show the
> application("product123") instead of getting the information from the
> database.
>
> If a change of pricing or availability occours, I will delete the
> application("product123"). The product.asp will check if it's empty.
> If it is, it will get the data from the database and show that, but
> the next time someone goes to that page, there is no need to connect
> to the database.
> I've used it many times for chunks of HTML (see
> http://www.learnasp.com/freebook/asp/speedappdata.aspx), but my
> question is, how much can I save in application data? Can I put 4000
> of them?
It depends on the server hardware (amount of RAM) and the number of
applications running on the server. This is the type of question that can
only be answered by testing. For example, we have on idea how much memory is
consumed by storing one of these productls, let alone 4000. If scalability
is a concern, you should be striving to avoid page faults.
The other concern is concurrency: I assume you have already realized the
need to lock the application object while making changes to its contents.
While the application is locked, no requests in the application can be
served. Whether this is a concern or not depends on the frequency of price
changes and can only be answered by testing.
Is the call to the database so time-consuming that caching the data in
application is necessary?
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"