Solved

Use of global.asa

Posted on 2013-01-03
1
319 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 38741257
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

617 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