FIT uses the CDR to determine the best way a document should be served to a client, but sometimes the static data can not reflect the real circumstances of a pending request. By dynamically determining the actual client area real estate, for example, a document can be better optimized for the current rendering situation, taking into account the current setup of the client. This is achieved by sending a snippet of JavaScript code to calculate and store more accurate information about the client. Subsequent requests are adapted to the new properties automatically.
To obtain these properties also for the very first request, FIT can send the Delivery Context Detection Page, which is a minimal HTML page containing the respective JavaScript before rendering the actually requested content with the best Delivery Context values possible.
These cookies are set by the JavaScript which is used to detect the accurate values:
Contains the URL of the referring document the client came from. It may be used to feed statistic tools.
Technically, this cookie will be stored for 30 days. However, FIT removes the cookie upon the next request, as it is only needed to provide the missing Referer
header when the Detection Page is used.
Makes technical information about the user’s Web browser, like viewport width and height, available to the server software. The cookie does not contain any tracking information.
This cookie will be stored for 30 days
Format: at least 16 parts ending in ‘:
‘. The system parts in the following order are:
6
.viewport/portrait
and viewport/landscape
DC properties.2
). The value must be a positive number <= 30. This is necessary for creating sharp images for higher-density clients.screen.width
value that can be used to improve the client/hw/display/width
DC properties.screen.height
value that can be used to improve the client/hw/display/height
DC properties.history.pushState
. Contains the information whether or not the client supports history.pushState()
. This is needed to determine whether partial page loading is available.All other (user) parts are added by the JS Detection API and have the format key=value.
Example:
fitdetection=6:583:983:983:583:landscape:1:1680:1050:true:true:false:true:false:false:true:foo=bar:
For the detection page to be sent, your request needs to meet the following criteria:
fitdetection
must either not be existing or have the wrong versionGET
apfail
must not be in the request urlm
must not be in the request urlX-Requested-With
header must not be XMLHttpRequest
X-moz
header must not be prefetch
X-Purpose
header must not be preview
Accept
header must contain text/html
js
must be trueclient/bot
must not be trueinclude-pattern
must match the request urlrobots.txt
or favicon.ico
exclude-pattern
must not match the request urlYou can enable the detection page in the ress
settings in your config.xml:
<config>
<ress>
<detection-page />
</ress>
</config>
The detection page config option offers multiple parameters.
title
: changes the html title of the detection page.include-pattern
(optional): may contain a regular expression pattern.exclude-pattern
(optional): may contain a regular expression pattern.title
parameterThe title
parameter replaces the default value used as title for the detection page. The value must be a non empty string. The default is FIT14 Detection Page
.
The following example shows how to generate a detection page with a different title:
<config>
<ress>
<detection-page title="Different Title" />
</ress>
</config>
title
attribute results in an empty title
element, creating an invalid document to be output. include-pattern
and exclude-pattern
parametersThe include-pattern
must match the client request URL to allow FIT to respond with the detection page. If specified, it replaces the default, which allows any URL (think .*
).
The exclude-pattern
must not match the client request URL to allow FIT to respond with the detection page. If specified, the exclude pattern will be added to the default exclusions (robots.txt
and favicon.ico
).
Requested URLs that match both include and exclude pattern will be excluded from detection page responses.
The following example shows how to prevent FIT from responding with the detection page for every request containing /downloads/
in the URL:
<config>
<ress>
<detection-page exclude-pattern="/downloads/" />
</ress>
</config>
script
parameterThe script parameter takes a FIDJ URI pointing to a JavaScript file that will be inlined and executed in the detection page.
Example config.xml:
<config>
<ress>
<detection-page script="fit://site/conf/js/script.js" />
</ress>
</config>
In the unlikely event of the client not supporting JavaScript, the page redirects to the originally requested URL, with a new URLMark fitscript=0
.
In the unlikely event of the detection page not working correctly the content will be loaded with the URLMark apfail
If enabled, the detection page can cause a HTTP redirect before the actual content is loaded.
The hardware display size of desktop clients is calculated from the detected viewport and pixel density.