views:

111

answers:

4

I have a question about asp.net compiling. I know the different ways you can compile but my question is with the default method. Microsoft says that pages and code are compiled on their first use and then cached. My question is, when does that cache clear... when the app pool recycles? Or, does it cache it until it's changed even through server reboots. Basically, if it compiles once and then caches it until it's changed I'm ok with it... if it recompiles with every reboot or app pool recycle I'm going to go the route of pre-compiling.

+1  A: 

The cache is cleared upon app pool shutdown, at each app pool startup it is re-compiled and cached.

Mitchel Sellers
+1  A: 

Whenever you change something to the source files it will recompile.

On startup (after shutdown) it will recompile too.

Changing something to the web.config reboots your web

Tigraine
One clarification to this, changing the front end ASPX pages (say changing the CSS class on a GridView) will not cause a recompile, only if the code behind file changes will the refresh occur.
Dillie-O
A: 

So the files are created in a temp folder but do not get cleared on shutdown. They will only be recompiled if something changes. So if you restart IIS or reboot the machine, they will not recompile. Just reload them from the temp folder.

Changes to any of the files of the project, or any files the project is dependant on will cause a recompile.

Tom
A: 

@Bob - Whats wrong with letting it recycle with the app pool?

StingyJack