Skip to content

Configuration & Check Priority

dingyuliang edited this page Feb 12, 2017 · 18 revisions

Configuration Setting Options.

This page is applicable for both ASP.NET Module web.config configuration setting and ASP.NET Core Middleware PrerenderConfiguration.json.

Options

  • ServiceUrl:

The prerender service URL, either prerender.io company service, http://service.prerender.io; Or the service you build by your own

  • Token:

If the prerender service has token, please set this option, otherwise, leave it EMPTY.

  • WhiteListPattern:

Specify the URL regex pattern which you want to use Prerender service.

  • BlackListPattern:

Specify the URL regex pattern which you don't want to use Prerender service.

  • AdditionalExtensionPattern:

Specify the file extension regex pattern in addition to default one, which you don't want to use Prerender service. Below is the default file extension regex pattern:

_\\.vxml|js|css|less|png|jpg|jpeg|gif|pdf|doc|txt|zip|mp3|rar|exe
|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg
|iso|flv|m4v|torrent
  • ProxyUrl:

If you use proxy server for your application, please specify proxy server url.

  • ProxyPort:

If you use proxy server for your application, please specify proxy server port.

  • CrawlerUserAgentPattern:

If you use different crawler user agent pattern than default, please specify here. Below is the default CrawlerUserAgentPattern

(google)|(bing)|(Slurp)|(DuckDuckBot)|(YandexBot)|(baiduspider)
|(Sogou)|(Exabot)|(ia_archiver)|(facebot)|(facebook)|(twitterbot)
|(rogerbot)|(linkedinbot)|(embedly)|(quora)|(pinterest)|(slackbot)
|(redditbot)|(Applebot)|(WhatsApp)|(flipboard)|(tumblr)|(bitlybot)
|(Discordbot)

Check Priority from top to bottom, highest to lowest.

  • Rule 1: _escaped_fragment_

    PrerenderHttpModule supports escaped_fragment query string, if you have escaped_fragment in your query string, it will use Prerender service.

  • Rule 2: CrawlerUserAgentPattern:

    If there is no escaped_fragment, then it will check CrawlerUserAgentPattern. If you don't have CrawlerUserAgentPattern option in web.config, we will use default value:

(google)|(bing)|(Slurp)|(DuckDuckBot)|(YandexBot)|(baiduspider)
|(Sogou)|(Exabot)|(ia_archiver)|(facebot)|(facebook)|(twitterbot)
|(rogerbot)|(linkedinbot)|(embedly)|(quora)|(pinterest)|(slackbot)
|(redditbot)|(Applebot)|(WhatsApp)|(flipboard)|(tumblr)|(bitlybot)
|(Discordbot)

If the request user agent matches this regex pattern, it will use Prerender service.

  • Rule 3: Default file extension ignore regex pattern.
_\\.vxml|js|css|less|png|jpg|jpeg|gif|pdf|doc|txt|zip|mp3|rar|exe
|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg
|iso|flv|m4v|torrent

if the relative URL matches this, it won't use prerender service.

  • Rule 4: AdditionalExtensionPattern

    This is the similar regex pattern as default file extension ignore regex pattern. If you specify any AdditionalExtensionPattern, if the relative URL matches this and passes above checks , it won't use prerender service.

  • Rule 5: BlackListPattern

    If you specify any BlackListPattern, if the raw URL matches this and passes above checks , it won't use prerender service.

  • Rule 6: WhiteListPattern

    If you specify any WhiteListPattern, if the raw URL matches this and passes above checks , it will use prerender service.

  • Rule 7: At last, if it passes above checks, it won't use prerender service.

Clone this wiki locally