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

Slow load time on any browser - large-ish yaml #133

Closed
TracyZuora opened this issue Nov 2, 2016 · 10 comments
Closed

Slow load time on any browser - large-ish yaml #133

TracyZuora opened this issue Nov 2, 2016 · 10 comments
Assignees

Comments

@TracyZuora
Copy link

Hello Redoc Community,

Our yaml file with code samples is about 2.2 MB and is slow to load. We are looking for alternative approaches that would allow us to remove most of this download/process time to improve the user experience. Does anyone have some advice for optimizing the load time?

www.zuora.com/developer (select API Reference)

@RomanHotsiy
Copy link
Member

Hello @TracyZuora.

First of all. I love how you styled ReDoc ❤️
I recommend you updating to the latest version of ReDoc to have this issue resolved: #130
Unfortunately I have made some changes in css in the latest version so probably you will have to do some minor extra work after update.

Now regarding slow load time:
we have experiencing the same issue (on RebillyAPI) and it is the next step on our roadmap.
In general: the main part of so slow loading is not caused by your spec file size but by amount of endpoints and methods you have - this is ReDoc performance issue.
Your swagger file loads in 4 seconds (you can shrink this time twice I believe by enable gzip on your server)
In your case the impact is so huge because of using a lot of code samples.

There is relative issue already opened so you can track this: #62

Also I won't close this issue to track your case.

@TracyZuora
Copy link
Author

Roman,

Do you think if we have multiple files instead of one file that the performance would be better? I will try this tonight. We are having the API Reference failing on load most of the time :-(

@zachwaggoner
Copy link

If you do separate the files would they have to load on multiple pages? Sort of a pagination if you will?

@TracyZuora
Copy link
Author

Roman, We love ReDoc but the performance issues are causing us to rethink the ReDoc approach. I want to stick with ReDoc but we are already looking to change. Is there anything that we could help with in diagnosing/fixing this issue?

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Nov 4, 2016

I understand your issue as we are also suffering from this 😢
As as workaround you can try to split your spec into smaller separate peaces (as a separate OpenAPI specs) and host a few ReDoc instances for each (if you need help with hosting multiple ReDoc instances, let me know)

We are working on resolving this issue, but it is quite complicated. I plan to fix this issue during next 2-3 weeks but I can't promise as I just have ideas in mind not the concrete solution. The basic idea is to move the main bottlenecks to the build step (check #62)

Is there anything that we could help with in diagnosing/fixing this issue

actually I have your spec for tests so don't need anything else at the moment, I will reach you if I need something

@RomanHotsiy
Copy link
Member

@TracyZuora I have released to CDN beta version of ReDoc with performance optimisations

Could you test it and provide your feedback?
Use the following link for referencing redoc.min.js: http://rebilly.github.io/ReDoc/releases/v1.6.0-beta.perf/redoc.min.js

This version is only on CDN, it is not available via npm

@TracyZuora
Copy link
Author

Thank you so much for expediting this fix. We will be testing the CDN fix this weekend and will post results. The Zuora Beijing team will jump on the testing first and I will follow suit in the US.

We love ReDoc!

@jenniferwang2000
Copy link

Thank you @RomanGotsiy!

From Beijing side, we updated the local redoc.min.js with the fix. The average loading time of our yaml file with code samples in a totally new incognito Chrome browser is about 13 seconds without lazy rendering, and 8 seconds with lazy rendering. After cached, the loading time is really fast around 2-3 seconds to load. Overall it is much faster than before.

@RomanHotsiy
Copy link
Member

@TracyZuora @jenniferwang2000
Just released a new version v1.6.0. It has lazy rendering feature.
To enable it use lazy-rendering ReDoc option:

<redoc spec-url="..." lazy-rendering></redoc>

Can I close this issue now?

@TracyZuora
Copy link
Author

Thank you Roman - please close the lazy rendering is working great! We will be uploading to our production environment this week.

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

5 participants