Solved

Use of global.asa

Posted on 2013-01-03
1
311 Views
Last Modified: 2013-01-03
Hi Experts,

Can anyone remind me the use of global.asa?

For example, I currenly have a shopping cart that I wrote my self, all of the prices are hardcoded in one common.asp file that I include where I need it.

Now, I need to store the prices into a db, so management can change them, and within my common.asp I'd get my prices from the db. However, I don't want to open my db every time I include common.asp and waste resources, as I'll be looping through 45 recs every time.

With this said, would this be where global.asa comes in?  I was thinking of having under Session_OnStart

arePricesRetreived = False

Then in common.asp, do:

If arePricesRetreived = False
  'Retrieve from DB
  arePricesRetreived = True
End if

Would this be the propper logic and use of global.asa?
0
Comment
Question by:APD_Toronto
1 Comment
 
LVL 32

Accepted Solution

by:
Big Monty earned 500 total points
Comment Utility
here's a good explanation of global.asa:

http://www.w3schools.com/asp/asp_globalasa.asp

basically, its a place to initiate data and set application and session objects. as for the logic you've suggested, do you need to have this data on every page of your application? I would imagine you don't, and if this is a high traffic website, you're better off only calling it on the pages you actually need. Otherwise you're storing data in memory that may or not be used, and wasting resources. I would recommend creating a function that can be accessed on every page that calls the data and returns it in the format you need, then call that function when and where you need it.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now