Compilation/precompilation Questions

Discussion in 'General troubleshooting' started by zigipha, Oct 20, 2009.

  1. Had a few questions about compilation/precompilation; talking about code that is in aspx files.
    1. I have read that precompilation makes "first page access" faster. Is this for the server or for the client? If for the server, then I would expect that the 2nd client that comes to the page for the first time will have faster performance. True?
    2. Is precompilation necessary for DASP? I have read that if i dont upload precompiled code, thent he server will compile on first call. True?
    3. How does the webserver know whether to use the newly uploaded .aspx file or the compiled version? Timestamp?

    Thanks!

    z
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Precompilation should make the server side compilation a little fast on first load.

    No. It is not necessary. It is entirely up to you.

    When you use precompile option. all the pages are compiled into the dll.

    Also review this for more info on precompile

    http://msdn.microsoft.com/en-us/library/399f057w(VS.85).aspx
     
  3. Followup question

    Bruce,
    thanks for reply and the link.

    Regarding question #3 - my question was assuming that the WEB SERVER is doing the compilation on the fly, how does it know to use the new .aspx file vs the compiled code that is cached?

    And a couple of new questions:
    1. the website i am working with (taking over for) have all the .aspx files with a single line of text "This is a marker file generated by the precompilation tool, and should not be deleted!". I assume that this is the result of precompilation, and that the previous uploader simply uploaded the precompiled files. Do you agree?

    2. For my website, i have a directory BIN with a bunch of .dll and .compiled files. I assume that these are the files being actually executed by the webserver. Correct?

    3. I do not want to be in the "precompilation" business. How do i have the server look at the newly uploaded .aspx file rather than look at the BIN directory?

    Much Thanks

    z
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    if you use precompile, the aspx page will not contain anything but some place holder text.

    1) Yes.

    2) Yes.

    3) do not pre compile. use VS.NET's copy website feature.
     
  5. Another follow-up questions

    Bruce,
    Thanks for you rapid response!

    I need further clarification on my previous question, as follows
    1. the previous maintainer of the website apparently use precompilation
    2. i want to update some of the aspx files
    3. Question: when i do the vs.net copy website feature, do i have to do anything else for the webserver to NOT use the precompiled files in /BIN? or will this happen automatically?

    Thanks!!
    z
     
  6. Bruce

    Bruce DiscountASP.NET Staff

Share This Page