Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

selay
Copy link

@selay selay commented Jul 11, 2013

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.

… type will not change during session. it makes sure the result whether device is mobile or not is checked only once during session, redusing extra overkill
@dhensby
Copy link
Contributor

dhensby commented Nov 21, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants