Conversation
…ie scripts to speed up selfie capture screen loading
|
Well the number I got is around 200+ms for the json on mobile device. Functionally it still works. ok, that may include wait time. So the download time seems similar. Guess that's what you are describing. |
aduth
left a comment
There was a problem hiding this comment.
Are these only loaded when applicable for selfie, i.e. not when document capture only? I wasn't able to find where these script sources are assigned.
| passiveLivenessSrc: getSelfieCaptureEnabled() | ||
| ? acuantVersion && `/acuant/${acuantVersion}/AcuantPassiveLiveness.min.js` | ||
| : undefined, | ||
| faceLandmarkWeightsSrc: getSelfieCaptureEnabled() |
There was a problem hiding this comment.
@aduth This is where the condition for the script loading is. Two points:
- These scripts are loaded only when the selfie is required.
- These scripts aren't actually -used- anywhere in our code. The point here is to cache them when we load the other Acuant scripts so when a user opens the selfie capture, there's a much smaller delay.
There was a problem hiding this comment.
Gotcha 👍 The main thing for me was only doing the background load when selfie was enabled, which looks like this code is handing. Not sure why I wasn't seeing this code when I searched "weights" earlier! Probably user error 😄
🛠 Summary of changes
This PR loads four additional scripts from Acuant when the document-capture page loads. This makes it so that when the user clicks on the selfie capture, that screen opens much faster b/c the scripts are cached.
📜 Testing Plan