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
[Bug 1058671] Cache geoip results. #2091
Conversation
Add cookies with the geoip results. If these cookies are present, the geoip script will not be included. These cookies expire after 30 days.
@@ -234,7 +234,10 @@ | |||
{% endif %} | |||
{# End Optimizely #} | |||
|
|||
<script src="//geo.mozilla.org/country.js" type="text/javascript"></script> | |||
{% if include_geoip %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we'll add a and request.locale == 'en-US'
here for that other request Kadir had.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I think we should add that in the context manager (less logic in templates and all that), but I also am not super excited about that particular change. I guess we should probably do it though.
Fixed the console.log stuff, added a 30 day expiry (instead of a session expiry) and only show it to en-US users. ^ |
Oh, and I added the tests I forgot to commit earlier, plus an extra pair for en-US/de checking. |
nice! r+ |
Add cookies with the geoip results. If these cookies are present, the geoip script will not be included. These cookies expire after 30 days.
r?