Uh oh!
There was an error while loading. Please reload this page.
Only load routes of the app which is requested - #13712
Conversation
nickvergessen
commented
Jan 21, 2019
This will break activity app, because it has to generate links for various other Apps? |
MorrisJobke
commented
Jan 21, 2019
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 |
skjnldsv
left a comment
There was a problem hiding this comment.
Tested and works fine.
Could not find any bug on various apps and core testing
MorrisJobke
commented
Jan 21, 2019
This might cause problem with OCS routes: https://github.com/nextcloud/server/pull/13714/files#diff-0c5fff2a86ede7f85fc3215283d957fcR113 Let me fix that. |
MorrisJobke
commented
Jan 21, 2019
And I will also add some tests 🙈 |
rullzer
commented
Jan 21, 2019
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
4fc464fCompareMorrisJobke
commented
Jan 21, 2019
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. |
MorrisJobke
commented
Jan 21, 2019
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: |
icewind1991
commented
Jan 21, 2019
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 |
rullzer
commented
Jan 22, 2019
Right. Yes and it needs to be there becuase it is a default get. |
Uh oh!
There was an error while loading. Please reload this page.
rullzer
left a comment
There was a problem hiding this comment.
Added the fallback.
Lets get this in!
MorrisJobke
commented
Feb 4, 2019
Changes by @rullzer make sense 👍 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
92ee378 to
b2141b7Compareb2141b7 to
b0e53d4Compareb0e53d4 to
bc853c2CompareUh oh!
There was an error while loading. Please reload this page.
6ab5975 to
d3ae6afCompareMorrisJobke
commented
Jul 5, 2020
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. |
MorrisJobke
commented
Jul 5, 2020
Should be ready for review now :) |
d3ae6af to
26d55edComparerullzer
commented
Jul 6, 2020
So we modify the code to make the test pass? That doesn't sound right. From my understanding include once is correct here. |
MorrisJobke
commented
Jul 6, 2020
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
df06251CompareMorrisJobke
commented
Aug 11, 2020
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 |
MorrisJobke
commented
Aug 11, 2020
I now properly injected the |
c4d01b5 to
9b285f0Compare* Add fallback to load all routes if needed * Move partial loaded routes test to proper place Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
9b285f0 to
387cac4Compare
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:
