Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

4 extra GET requests on every page view #4084

Closed
mblayman opened this issue Jan 29, 2014 · 1 comment
Closed

4 extra GET requests on every page view #4084

mblayman opened this issue Jan 29, 2014 · 1 comment

Comments

@mblayman
Copy link

Hi, I couldn't find an email forum for Persona so my apologies if this is an inappropriate place to resolve this "issue."

I'm implementing Persona for a website I'm developing. The integration is complete and I noticed some behavior via Firebug that has me puzzled. For every single page view, I now see four additional GET requests.

GET communication_iframe (140ms)
GET session_context (190ms)
GET list_emails (150ms)
GET address_info (180ms)

I observed the same requests happening on 123done.org and voo.st which seem to be well known examples of Persona login implementors.

My concern is that these additional requests add sizable delay (roughly 650ms) to my otherwise snappy website. I've worked around the behavior by doing some dances with my HTML template engine to prevent that JavaScript from being included when not in use, but that is a rather unfortunate thing to have to do.

I don't understand the implementation details of Persona to why this is necessary or if I'm doing it wrong. My naive view would tell me that once Persona has authenticated, then the trust relationship is just between the user and the website. It seems like phoning home to login.persona.org all the time is incorrect.

One additional data point: MDN also uses Persona and I do not see these extra requests happening for that site. Is Mozilla holding back the secret library to make Persona faster? ;) Just kidding. I just want to make my stuff efficient so any help would be much appreciated.

I doubt this matters, but I'm using Firefox 26 on Ubuntu 13.10.

@fmarier
Copy link
Contributor

fmarier commented Jan 29, 2014

The Persona forum is this one: https://www.mozilla.org/about/forums/#dev-identity

I suspect that the difference you're seeing between MDN and your site is that MDN is using the Callback API whereas you are using the Observer API.

The Observer API is more powerful, but it does require a few extra requests, but that should be reduced by #4079, #2549 and #3035.

If these extra requests are a problem for your site, you may want to consider switching to the Callback API.

@fmarier fmarier closed this as completed Jan 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants