ASP.NET

  • bannerpad
  • Novice
  • Novice
  • bannerpad
  • Posts: 18

Post 3+ Months Ago

Does anyone know how to make it so ASP.NET files (.aspx) get compiled without having someone visit it 1st.

I wish to compile all the pages so even when someone visits it for the 1st time, it will still be fast.

Right now, the 1st time someone visits a .aspx page, it has to compile and can take a while.

Thanks.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I think you could probably achieve it by caching the aspx pages in IIS on the server, however I'm not at work, and can't remember exactly how to adjust the settings at the moment. Perhaps someone can offer the how-to in the meantime.

Actually a very quick Google search for : cache aspx

lead me to this page: http://aspnet.4guysfromrolla.com/articles/022802-1.aspx

That should be what you are after.
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

That said... (good reference ATNO, by the way!)

You don't compile ASP pages. The are run-time compiled. If you want to compile your code, you would be doing a thing called creating COM objects.

.c
  • LAbrego
  • brego from LA
  • Web Master
  • User avatar
  • Posts: 2855

Post 3+ Months Ago

Caching could be great if your pages are mostly static, if they change a lot it'll be no difference in performance. One thing I always do with aspx files when I modify them is simply open it myself for the first time, this way I not only sure it works fine but I save my user from waiting.

But if you really want to do that check this article

http://www.codeproject.com/aspnet/PreCompileAspx.asp
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

They call this pre-compiling, but it looks more like caching output to me. .NET sort of blurs the lines between compile-time and run-time execution, even more than Java does, but if you can open the files that the end user will be accessing and view the source code with a text editor, then the application isn't really being compiled.

Compliation involves parsing the source and translating that into machine code of some sort. Different languages and compilers have different definitions of this and some are more portable than others without much effort (Java vs C++, for example...), but the end result is a file that when viewed as text looks like gobbledygook...

Why do I really care? I don't.

.c
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

From what I can remember, the difference between compiled and interpreted(run-time compiled) is this:

A compiled language will be converted from source code into machine code and then the machine code will be executed at run time

An interpreted language is compiled and then executed, <b>one line at a time</b>, at run time. It needs to be interpreted every time the application is executed.

Thats the text-book definition. TBH I can't see how you can blur the edges of that, it seems pretty clear cut. As Carnix said, if you can read the file, its interpreted, otherwise it's compiled and the file will look like squares mostly :)

If this really was compilation then you would notice an improvement in performance even if the output changed every time. You would also have to manually recompile every time you changed the source code

I only care because I have to learn all this theory for an exam in two weeks lol
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

rtm223 wrote:
From what I can remember, the difference between compiled and interpreted(run-time compiled)


heh, I was brain-farting on the word Interpreted.. heh. I KNEW there was a technical term for it that I couldn't think of... =]

.c
  • rtm223
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1855
  • Loc: Uk

Post 3+ Months Ago

lol, as I said I've gotta learn all this theory, although <b>none</b> of it is actually any use in real terms - it's just another A level and I should get an A in it - it's just for my CV.

TBH I wasn't sure if run-time compiled was a different technical term for the same thing, like "interpreted language"="scripting language". My brother (programs C/C++) told me off last week for calling PHP a programming language :lol:
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

It is a programming language. A programming language is nothing more than a structured system to make a computer execute computations in a specific way. Some languages are more robust in what sorts of things it can make the computer do than others, C++ is very robust since it can access any aspect of a system, JavaScript isn't, since it's isolated to the stuff inside of a web browser's window object, but it's still a programming language.

Purists are annoying like that. It's not all about one thing or another being best. You use the tools that best fit a given job. Not everything needs to be programmed in C, and sometimes using a compiled program is actually less affective than simply writting a script.

Imagine having to write custom admin scripts for Linux in C every time, instead of using Perl. Ugh. What a nightmare that would be... Both initial writting and updates... forgetaboutit.

.c

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 61 guests
  • 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 post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.