silverstripe-archive / silverstripe-mobile

Mobile support module for SilverStripe CMS
http://silverstripe.org/mobile/
BSD 3-Clause "New" or "Revised" License
35 stars 36 forks source link

odified is_mobile to cache previously detection result because device ty... #41

Open selay opened 11 years ago

selay commented 11 years ago

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.

dhensby commented 8 years ago

This makes sense, though I'm conscious there doesn't appear to be a way to override it manually?