-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Only load routes of the app which is requested #13712
Conversation
This will break activity app, because it has to generate links for various other Apps? |
Not really. It will only load the app for which the URLs where requested. So it does not open all the But if you request then |
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.
Tested and works fine.
Could not find any bug on various apps and core testing
This might cause problem with OCS routes: https://github.com/nextcloud/server/pull/13714/files#diff-0c5fff2a86ede7f85fc3215283d957fcR113 Let me fix that. |
And I will also add some tests 🙈 |
Yeah ocs is different unforntuantly. Did you also test this with the caching router? As I assume this will then have less effect. |
52812cc
to
4fc464f
Compare
It was with caching enabled, but somehow still caused the generation of the URL for each request. Maybe something we should look into separately. I fixed the OCS stuff and added tests. This is now ready to go in here. Also the OCS routes are just a weird hack and maybe require some more generalization but this is a different topic. |
I know why this failed. The logout URL has the request parameter in the URL: server/lib/private/legacy/user.php Lines 272 to 277 in bb86a8c
And thus the caching does not hit in:
|
maybe worth adding a fallback to loading all routes? I don't know if there is any code out there that messes with the route name format |
Right. Yes and it needs to be there becuase it is a default get. |
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.
Added the fallback.
Lets get this in!
Changes by @rullzer make sense 👍 |
92ee378
to
b2141b7
Compare
b2141b7
to
b0e53d4
Compare
b0e53d4
to
bc853c2
Compare
6ab5975
to
d3ae6af
Compare
The change for the routes to be loaded via include instead of include_once is to allow it to properl load them in the unit tests as they re-initiate the routes during the same execution cycle. |
Should be ready for review now :) |
d3ae6af
to
26d55ed
Compare
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.
🐘
So we modify the code to make the test pass? That doesn't sound right. From my understanding include once is correct here. |
Not in the context of changed behavior:
But I'm fine with refine this and change that. On the other hand: we need to re-profile, because the causing issue seem to be solved as the timing doesn't improve that heavily anymore for me locally. |
26d55ed
to
df06251
Compare
I reverted the change and instead streamlined the tests a bit (it initialized once the router per test case which then hits the limitations of this implementation due to the |
I now properly injected the |
c4d01b5
to
9b285f0
Compare
* Add fallback to load all routes if needed * Move partial loaded routes test to proper place Signed-off-by: Morris Jobke <[email protected]>
Signed-off-by: Morris Jobke <[email protected]>
9b285f0
to
387cac4
Compare
This removes ~70-90 ms on every request that involves a URLGenerator (in this case the stats are from the files default view). The total request too ~800ms so this is around 10%.
Before:

After:

Diff:
