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.
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.