silverstripe/silverstripe-mobile — pull request #41 by ielmin (2013-07-11 07:46:12+00:00)
Title: odified is_mobile to cache previously detection result because device ty...

modified is_mobile() function to cache the result of detection because
device type will not change during session. it makes sure the result whether device is mobile or not is checked only once during session, reducing extra overkill. Whenever, is_mobile is called, before going to check headers, user agent etc to see whether it is mobile what type is it, it just returns the existing result because this device just made a request and was detected.