User Agent

To determine if a user agent is a bot or a mobile device, patterns are used to match User-Agent request header. The configuration file is [cmobilecom.home]/conf/user-agent.xml. For example,

<user-agent>

	<bot>
		<pattern>.*(spider|bot|crawler).*</pattern>
	</bot>

	<mobile>
		<pattern>.*(mobile|sm-t|touch|android).*</pattern>
	</mobile>

</user-agent>

Bot

If User-Agent header matches any of the bot patterns(case insensitive), it is regarded as a bot. Patterns are regular expressions. For a bot, HTTP sessions will not be created, and view states will not be saved. Note that a long list may incur some performance overhead.

Mobile

If User-Agent header matches any of the mobile patterns(case insensitive), it is regarded as a mobile device. Patterns are regular expressions. Whether the user agent is mobile determines how Cmobilecom AF responds differently to desktop and mobile devices.