-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Deprecation of returning all assets via the API #14140
Comments
Work has been prepared to enact this deprecation, in the new API worker, and in the docs: |
API docs change is live in production: https://cdnjs.com/api#library API change is live for 10% of production traffic. |
The rollout of this was paused at 10% due to the dependency discovered within LibMan on this field. Once they've shipped updates, we plan to continue this rollout. #14141 & aspnet/LibraryManager#685 can be used to track progress on LibMan. |
This is now live for 25% of traffic: https://github.com/cdnjs/api-server/runs/7395641390 |
This is now live for 50% of traffic: https://github.com/cdnjs/api-server/runs/7416499906 |
This is now live for 75% of traffic: https://github.com/cdnjs/api-server/runs/7435971283 |
This is now live for 100% of traffic: https://github.com/cdnjs/api-server/runs/7456158760 |
With this API change now completed and live, as well as the docs being updated on the site, closing this issue out. Will leave it pinned until anything supersedes it. |
v1.0.9 : update for changes in cdnjs api see cdnjs/cdnjs#14140
Hey folks!
Proposal
Moving forward, the cdnjs API endpoint
/libraries/:library
will no longer return assets for all versions of the library in theassets
array. Instead, this array will only contain a single item with the assets for the latest version of the library.The cdnjs API provides, and will continue to provide, the
/libraries/:library/:version
endpoint that will allow you to access assets and SRI hashes for a specific version of any library, and theversions
property of the/libraries/:library
endpoint response will continue to list all versions.We hope this change will be non-breaking for most folks, as the type signature of the response from the endpoint will not be changing, only the number of items in the
assets
array being reduced to one, the latest version.Justification
The reason behind us making this change and deprecating the full array in this response is simple -- it doesn't scale. As we look to move the cdnjs API to be a Cloudflare Worker instead of an Express server, we're more aware than ever of the resource usage behind each request hitting the cdnjs API and this array was proving to be a hard blocker for migrating to Workers.
For some libraries, like mathjax, this array contained 45 versions, with some containing over 25 thousand files (repeated essentially three times as we return both the
files
andrawFiles
properties, plus SRI hashes), resulting in the response being upwards of 100MB of raw JSON data. This resulted in resource consumption that proved problematic for our Express server, and a complete blocker for a Worker.Our work to move the cdnjs API to Cloudflare Workers is part of ongoing high-priority work to improve the stability of the cdnjs API, which has recently had issues resulting in incidents declared and bad responses returned to consumers.
Timeline
Due to this deprecation not resulting in a type signature change to the endpoint, our belief that removing old versions from the response is unlikely to impact many (if any) API consumers, and it resolving an active technical blocker for improving API stability, we've introduced a shortened timeline for this deprecation.
The text was updated successfully, but these errors were encountered: