zoukankan      html  css  js  c++  java
  • IIS 预热 (8.0及8.0以上版本)

    The two new additions in IIS 8 are

    image

    Preload Enabled

    This setting is available if you have the Application Initialization module installed

    image

    The preloadEnabled metabase setting along with the startMode setting can be used to ‘warm up’ your web application.

    When you set the startMode property of your application pool to AlwaysRunning a worker process is spawned as soon as IIS starts up and does not wait for the first user request. But this does not mean the web application is initialized.

    When you set preloadEnabled to true, IIS will simulate a user request to the default page (can be changed with initializationPage metabase setting) of the website/virdir so that the application initializes. The request is not logged in the IIS logs.

    But you can trace this with FREB. Every time you restart your application pool you will see a FREB trace file for the dummy request. You can identify this request by analysing the GENERAL_REQUEST_HEADERS and looking at the User-Agent string.

    User-Agent: IIS Application Initialization Preload

    Maximum Url Segments

    With the maxUrlSegments metabase setting you can control the number of segments in an URL that your web application can serve. A segment is nothing but the number of / in your URL. This is a security setting that you can use to control the depth to which a user can browse your website.

    So for example say you have an application whose URL are mostly of the format http://website/virdir/page,  you can set the maxUrlSegments to 3. This stops probing attacks.

    If a user tries to browse an URL with segments exceeding this limit he/she will see a 404 message and a 404.20 HTTP status code will be logged in the IIS logs.

    Tags 
     
     
    C# Codeing:
     
    //When App Start

    using (var dbcontext = new DBEntities())
    {
    var objectContext = ((IObjectContextAdapter)dbcontext).ObjectContext;
    var mappingCollection = (StorageMappingItemCollection)objectContext.MetadataWorkspace.GetItemCollection(DataSpace.CSSpace);
    mappingCollection.GenerateViews(new List<EdmSchemaError>());
    }

  • 相关阅读:
    jmeter取样器
    【递归】普通递归关系
    7月,开始奋斗吧!
    BZOJ 1503 郁闷的出纳员
    bzoj 3262: 陌上花开
    BZOJ 2286 消耗战
    莫队
    bzoj1483: [HNOI2009]梦幻布丁
    字符串算法模板
    高级数据结构模板
  • 原文地址:https://www.cnblogs.com/Johnson-zhao/p/9046667.html
Copyright © 2011-2022 走看看