Can I compile regular ASP-code in to an aspx-file?

  • Thread starter Thread starter =?iso-8859-1?Q?G=F6ran_Carlefyr?=
  • Start date Start date
?

=?iso-8859-1?Q?G=F6ran_Carlefyr?=

Hi everyone, i've heard that aspx-files can be compiled
code so that the webserver just have to deal with the code
once, is that true?

I'm a complete newbie to .NET, i've never made anything in
ASP.NET but i've been coding ASP for approx. 3 years.

The reason I'm asking is because I have this menu that
have x numbers of database connections and it takes like
one second after the graphics before the menu appears.

That's why I had this question about compiled code, I just
wan't the webserver to deal with the database connection
in the menu the first time I surf to that specific page.
 
All code that is run on a web server, whether it's ASP or ASP.Net, is
compiled. ASP uses scripting, which is compiled at run time, each time the
page is requested. ASP.Net uses a variety of options, including compiled
DLLs and code that is compiled at run-time and then cached, to increase
performance. In other words, ASP pages are recompiled with each request,
while ASP.Net pages are compiled once and then cached.

However, this doesn't solve all of your problems. If you have a menu that is
getting its' members from database queries, the code to get the data may be
compiled, yes, but it must still be executed, and the database values have
to be fetched with each request for any page that contains that menu. If the
menu content doesn't change very often, you would probably do best to cache
the data that is fetched for the menu, so that it can be grabbed straight
out of memory, rather than fetching it from the database with each request.
Database hits are one of the most expensive operations an application can
execute.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.
 
Back
Top