-
Notifications
You must be signed in to change notification settings - Fork 198
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 put platforms list is less than 10, otherwise load with AJAX #2181
Only put platforms list is less than 10, otherwise load with AJAX #2181
Conversation
cc @Nemo157 |
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.
I assume this is a significant part of the html sent for libc currently, have you measured how much it is?
It's currently 18.972 bytes. https://docs.rs/libc/latest/libc/ is 888.749 bytes. So it roughly represents 2.13%. Not that much for big pages, but for pages like https://docs.rs/libc/latest/libc/constant.ABDAY_1.html (which is 55.753 bytes), it represents 34%. |
bd79c9d
to
221fef4
Compare
221fef4
to
75541b6
Compare
I added test for this feature and updated the failing ones (needed to update URLs mostly). It's now ready for review! |
Updated the routes. |
…outes to `/-/menus/`
fc21f64
to
4810adc
Compare
Fixed the |
4810adc
to
03b91d5
Compare
03b91d5
to
91495fc
Compare
… is a crate root or not
91495fc
to
237a3ab
Compare
f33f114
to
60ced40
Compare
Fixed the bug, improved the test a bit and updated the |
60ced40
to
a8be4b0
Compare
Found a couple more bugs clicking around pages:
|
d065c06
to
65de79a
Compare
65de79a
to
529aa33
Compare
Fixed all the URLs I could think of in |
I think that LGTM now, can't find any more issues clicking around 🎉 It might be good to have @syphar or someone to confirm the CSP change is fine, I can't think of any issues it could cause but I'm not that familiar with it. |
🎉 Thanks for the review! I'll send a follow-up once merged about the |
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.
reading about connect-src
I believe the CSP change is fine.
Apart from that:
Looking back at #2113 we used the /:crate/
prefix so the cache invalidation would cover the release-list. While we don't return a caching header in get_all_releases
(yet, which I definitely overlooked), we should keep CDN caching in mind also for the platform list fetching.
And using the /-/
prefix would bring the need to either add a new path to invalidations, or perhaps introduce a different prefix? ( I could imagine /:crate/-/...
, if that doesn't overlap with rustdoc)
05b7435
to
83aca23
Compare
83aca23
to
686fb37
Compare
Changed the menus URLs to start with |
Anything else that remains to be done here? |
sorry for the delay, from my side I see that the routes were changed. I think a last manual test after the route change would be good, if @Nemo157 doesn't have time I could dig into this. |
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.
Just did another quick manual test and couldn't find any issues
🎉 |
Based on the same principle as #2113.
This PR does actually two things: only load releases if the "big menu" is opened and not if any menu is open. It allows to only load if needed even further.
The second part is actually adding the async load for the targets if there are more than 5 (having libc in mind for that).
If this approach looks good to you, I'll finish the PR by adding tests.