简体   繁体   中英

ASP.NET 5 MVC 6 precompile - improve performance

I've got an application running internally on our IIS 8 server. I'm using an Empty ASP.NET 5 Template where I'm using the MVC6, EF7 packages and some others.

I've used Database-First to make objects of a pretty big database with over 200 tables which I am using in my API requests.

This application takes about 2 minutes after launching it and making the first request to the api endpoint to compile(i think?). The requests after the first are almost instant.

Also when the IIS server is reset (or after it's recycling) the first request is about 2 minutes again.

When I was using ASP 4.5 (MVC5) I could precompile when publishing. This option seems to have disappeared.

But my real question is: what can I do to make my application run fast even on the first request?

When you publish, by default, dnu publishes the sources and they are compiled on the fly when the server starts.

You can use the --no-source option to precompile everything. That should speed up startup ( --runtime is optional):

dnu publish --no-source [--runtime active|<name of runtime>]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM