httpRequestBegin

httpRequestBegin

httpRequestBegin Pipeline

  • Pipeline used to generate and populate the Sitecore.Context class
  • The Sitecore.Context class contains information about the context user, the context site, the item being requested, etc.
  • Each step in the pipeline populates just a single item in the context

httpRequestBegin Pipeline Processors

  • CheckIgnoreFlag
  • StartMeasurements
    • Starts a timer and stores the timer value and the requested URL
  • IgnoreList
    • Checks if the requested page is in the ignore URL list in the web.config
    • Set IgnoreUrlPrefixes to a '|' separated list of url prefixes that should not be regarded and processed as friendly urls (ie. forms etc.)
    • If such page is defined, the pipeline terminates
  • SiteResolver
    • Parses the incoming URL
    • Tries to resolve the site name from the sc_site query string value
    • Tries to resolve the site name from the host name or virtual folder name
  • UserResolver
    • Resolves the Sitecore context user making the request
  • DatabaseResolver
    • Resolves the Sitecore context database
    • Each managed Web site can specify the default context database for that site
    • The default context database is the database associated with the context site
    • Sitecore user interfaces and URL query string parameters can be used to specify a different context database
  • Begin Diagnostics
  • DeviceResolver
    • Resolves the current Sitecore device
    • Returns the first defined value from the following list that specifies a valid device:
      1. The value of the context device property
      2. The sc_device query string parameter
      3. The device attribute of the context site
      4. The first device in the context database that matches the URL query string parameters or Web client user-agent associated with the current HTTP request
      5. The defaultDevice attribute of the context site
      6. The first device with the Default checkbox field selected in the Data section
  • LanguageResolver
    • Resolves the Sitecore context language
    • Returns the first defined value from the following list:
      1. The value of the property
      2. The value of the Sitecore language cookie associated with the context site
      3. The value of the language attribute in the context site definition
      4. The value attribute of the /configuration/sitecore/settings/setting element in web.config with name DefaultLanguage
    • Sets the context language if the sc_lang query string parameter specifies a valid language, or if the languageEmbedding attribute of the link manager configuration is a value other than never and the first step in the path of the URL specifies a language
  • CustomHandlers
    • Triggers custom handlers that are defined in the <customHandlers /> section
  • FilterUrlExtensions
    • Defines the allowed/blocked extensions that will be either streamed or not
    • Allows .aspx extensions
    • Blocks .css and .js extensions that are streamed
  • QueryStringResolver
    • Analyzes such query string as “sc_itemid”
    • If the ID specified as the value is valid and if the item is found in the context database, then the returning item is set as a context item
  • DynamicLinkResolver
  • AliasResolver
    • Checks the requested URL to see if it matches an alias that exists on the system
    • Sitecore processes either external URL or the real item that is associated with this alias
  • DefaultResolver
    • Resolves the start path item for the context site
    • Sitecore instantiates this item using the “RootPath” and “StartItem” attributes of the context site by simply concatenating these values
  • FileResolver
    • Resolves the file system path for file items
  • ItemResolver
    • Resolves the Sitecore context item from the incoming URL
  • LayoutResolver
    • Returns the presentation logic for the resolved item
  • ExecuteRequest
    • Rewrites the context path and handles the “item not found”/”layout not found” errors
  • <configuration>
    • <sitecore>
      • <pipelines>
        • <httpRequestBegin>

<!-- Check if the pipeline should be ignored and terminates the pipeline if true -->

  • <processor type="Sitecore.Pipelines.PreprocessRequest.CheckIgnoreFlag, Sitecore.Kernel" />

<!-- Start a timer and store the timer value and the requested URL --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.StartMeasurements, Sitecore.Kernel" />

<!-- Checks if the requested page is in the ignore URL list in the web.config and terminates the pipeline if true --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.IgnoreList, Sitecore.Kernel" />

<!-- Call method to resolve the context site --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.SiteResolver, Sitecore.Kernel" />

<!-- Call method named 'process' to resolve the context user --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.UserResolver, Sitecore.Kernel" />

<!-- Call method to resolve the context database --> <processor type="Sitecore.Pipelines.HttpRequest.DatabaseResolver, Sitecore.Kernel" />

  • <processor type="Sitecore.Pipelines.HttpRequest.BeginDiagnostics, Sitecore.Kernel" />

<!-- Call method to resolve the context device --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.DeviceResolver, Sitecore.Kernel" />

<!-- Call method to resolve the context language --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.LanguageResolver, Sitecore.Kernel" />

<!-- Triggers custom handlers that are defined in the <customHandlers /> section --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.CustomHandlers, Sitecore.Kernel" />

<!-- Defines the allowed/blocked extensions that will be either streamed or not --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.FilterUrlExtensions, Sitecore.Kernel">
    • <param desc="Allowed extensions (comma separated)">aspx</param>
    • <param desc="Blocked extensions (comma separated)">*</param>
    • <param desc="Blocked extensions that stream files (comma separated)">css,js</param>
    • <param desc="Blocked extensions that do not stream files (comma separated)">*</param> 
  • </processor>

<!-- Call method to resolve query strings --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.QueryStringResolver, Sitecore.Kernel" />

<!-- Call method to resolve GUIDs in dynamic links to relative or absolute paths --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.DynamicLinkResolver, Sitecore.Kernel" />

<!-- Call method to resolve aliases to the item that they represent --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.AliasResolver, Sitecore.Kernel" />

<!-- Resolve the start path item for the context site --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.DefaultResolver, Sitecore.Kernel" />

<!-- Resolve the file system path for file items --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.FileResolver, Sitecore.Kernel" />

<!-- Call method to resolve the context item requested by the URL --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel" />

<!-- Call method to resolve the layout for the context item --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.LayoutResolver, Sitecore.Kernel" />

<!-- Rewrite the context path and handles the “item not found/layout not found” errors --> 

  • <processor type="Sitecore.Pipelines.HttpRequest.ExecuteRequest, Sitecore.Kernel" />

</httpRequestBegin>

Sources