Reply to topic
Question about Application_BeginRequest in global.asax
whitesites
Forum Regular

Joined: 05 Jul 2004
Posts: 310
Location: Houston, TX
Reply with quote
My question is does this get called for every request to a server, or only dynamic requests? IE if I have an asp.net page with 3 externally referenced files, and 20 pictures, would this result in the Application_BeginRequest being hit 24 times, or only for the initial asp.net page? The reason I am asking is because I have some code that runs on the BeginRequest. It makes a DNS call to determine if the IP of the user has a history of Abuse, and then rejects them if so. But on one of my sites, I get well in access of 1,000,000 hits / day. I am worried about the performance hit I might be taking if object is called on hits and not just pageviews.
dmalone
HostMySite Tech

Joined: 23 Nov 2004
Posts: 65
Reply with quote
I couldn't find a really straight answer on this. I would throw some debug output in there (if you can at that point in the request life cycle, not sure about that) and hit a page with some images to see how many times it gets printed.

Or you could make it send an email, anything to see how many times it runs through.

Not sure if you found these links or not, but this is what I was reading:
http://msdn.microsoft.com/en-us/library/system.web.httpapplication.aspx
http://msdn.microsoft.com/en-us/library/ms178472.aspx

Maybe they will make more sense to you Smile

Any reason you aren't doing this when their session starts instead?



-Dave
whitesites
Forum Regular

Joined: 05 Jul 2004
Posts: 310
Location: Houston, TX
Reply with quote
Now that I think about it. I could just apply this to Session_start instead. Thanks
Question about Application_BeginRequest in global.asax
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic