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

Remove 6 second delay from login screen(s) #4

Open
blobaugh opened this issue Oct 17, 2016 · 4 comments
Open

Remove 6 second delay from login screen(s) #4

blobaugh opened this issue Oct 17, 2016 · 4 comments

Comments

@blobaugh
Copy link
Contributor

blobaugh commented Oct 17, 2016

The login screen takes a significant amount of time to load. This is due to it making a request to login.windows.net whenever the page loads. That request is taking 6 seconds to perform. It is not strictly necessary.

Here is the function that is running: https://github.com/WebDevStudios/aad-first-party-sso-wordpress/blob/master/Settings.php#L144

It should be updated to cache the json output in a transient for a while and look there. It currently attempts to load a file. Maybe that was a caching attempt but it will never work.

Should be an easy refactor.

@jtsternberg
Copy link
Contributor

It currently attempts to load a file. Maybe that was a caching attempt but it will never work.

Just a clarification, that json file location was what the original author was using to configure the plugin (because there was no admin settings).

@blobaugh
Copy link
Contributor Author

Right, it is still going out attempting to locate a json file. Is that to set setting defaults or should it be removed in this version?

@jtsternberg
Copy link
Contributor

I mean, it could theoretically still be used to load settings (instead of using the DB), so whether that should be removed is up to you, I guess. The idea, though, about caching the lookup to login.windows.net makes perfect sense to me.

@blobaugh
Copy link
Contributor Author

We want to have the settings in the db though ;). If this json file is not loading defaults in that we need to care about then I vote we remove it and save ourselves the 6 seconds of load time.

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

No branches or pull requests

2 participants