? Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
1 Sep 2022

Pull Request for Issue #38654.

Summary of Changes

Loads the MDS cache when is needed and not on object instantiation.

Testing Instructions

You need to have a host where you see a performance loss when the webauth system plugin is activated.

Actual result BEFORE applying this Pull Request

Slow page load.

Expected result AFTER applying this Pull Request

Fast page load.

avatar laoneo laoneo - open - 1 Sep 2022
avatar laoneo laoneo - change - 1 Sep 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Sep 2022
Category Front End Plugins
avatar laoneo laoneo - change - 1 Sep 2022
Title
Lazy load the web auth MDS cache
Lazy load the web auth MDS cache in system WebAuthn plugin
avatar laoneo laoneo - edited - 1 Sep 2022
avatar nikosdion
nikosdion - comment - 1 Sep 2022

The problem with this approach is that if the server cannot reach the FIDO server (e.g. site behind a firewall, network error, whatever) every call to the service's getKnownAuthenticators will cause another roundtrip to the remote server, the site slows down and possibly times out.

For this approach to work you'd need a flag to indicate if load has been called instead of checking $this->mdsCache.

Moreover, if you have $force you need to go through the loading process anyway, regardless of the flag status.

avatar laoneo laoneo - change - 1 Sep 2022
Labels Added: ?
avatar coolcat-creations
coolcat-creations - comment - 1 Sep 2022

Just tested unsuccessful

avatar laoneo
laoneo - comment - 1 Sep 2022

Missed the force flag

avatar HLeithner
HLeithner - comment - 1 Sep 2022

Can't we ship the file with joomla? based on the fido alliance website it's updated once a month and changes not too often.

avatar nikosdion
nikosdion - comment - 1 Sep 2022

@HLeithner We could. Maybe we could move it inside the plugin and have the build script update it every time we build Joomla?

avatar laoneo
laoneo - comment - 1 Sep 2022

But I would still lazy load it

avatar HLeithner
HLeithner - comment - 1 Sep 2022

@HLeithner We could. Maybe we could move it inside the plugin and have the build script update it every time we build Joomla?

yes updating it in the build process seems to be the best idea. Also websites without internet access would have problems...

avatar nikosdion
nikosdion - comment - 1 Sep 2022

@HLeithner However, this would still be half of the problem solved. The other half is that we don't want to decode that massive JWT on every page load. If we are storing this file locally maybe we could instead store a serialised version of the decoded file. Loading serialised data is faster than decoding JWT by several orders of magnitude.

avatar HLeithner
HLeithner - comment - 1 Sep 2022

@HLeithner However, this would still be half of the problem solved. The other half is that we don't want to decode that massive JWT on every page load. If we are storing this file locally maybe we could instead store a serialised version of the decoded file. Loading serialised data is faster than decoding JWT by several orders of magnitude.

yes decoding it for faster access makes sense
and only load it if it's really needed as allon said.

avatar nikosdion
nikosdion - comment - 1 Sep 2022

@HLeithner Do you want me to try that approach? What @laoneo does is a good band-aid to stop the problem, preloading the file and shipping it with Joomla would be the more permanent solution. Let's divide and conquer.

avatar laoneo
laoneo - comment - 1 Sep 2022

Agree, we should get this one as fast as possible tested. And also look for more optimization in the long run.

avatar HLeithner
HLeithner - comment - 1 Sep 2022

@HLeithner Do you want me to try that approach? What @laoneo does is a good band-aid to stop the problem, preloading the file and shipping it with Joomla would be the more permanent solution. Let's divide and conquer.

yes please.

I don't know if a 4.2.2 will be released soon at least we have a fix here to ship, since it doesn't effect all servers and the plugin can be disabled (not my decision anyway)

avatar brianteeman
brianteeman - comment - 1 Sep 2022

if you didnt already see it #38662

avatar Fedik
Fedik - comment - 1 Sep 2022

I have tested this item successfully on 59d166b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38661.

avatar Fedik Fedik - test_item - 1 Sep 2022 - Tested successfully
avatar laoneo
laoneo - comment - 1 Sep 2022

Closing in favor of #38664.

avatar laoneo laoneo - change - 1 Sep 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-09-01 11:10:06
Closed_By laoneo
avatar laoneo laoneo - close - 1 Sep 2022

Add a Comment

Login with GitHub to post a comment