ASP.NET How expensive is it to call an Application Variable many times?

Posted by Matias Nino on Stack Overflow See other posts from Stack Overflow or by Matias Nino
Published on 2009-03-29T08:53:24Z Indexed on 2010/05/27 7:51 UTC
Read the original article Hit count: 303

The short of it is: Is it costly to check an Application Variable such as Application("WebAppName") more 10-20 times each time a page loads?

Background: (feel free to critique)

Some includes in my site contain many links and images which cannot use relative urls due to their inclusion in different paths.

Hence these includes contain frequent instances of

<img src="<%=Application("Webroot")%>images\image.gif">

Is it expensive to keep calling an Application variable like this?

Should I just put the Application value in some local variable to use where needed?

IMPORTANT NOTE:

I need my webapp to run fine on a server whether it be in the root web ("/") or in a virtual subweb ("/app").

Thanks in advance for any wisdom shared.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about Performance