You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, @cdnjs team. I have a suggesting regarding hits. We can have a item in the api response json regarding hits. JsDelivr also provides an api and It is widely used for badges like . Likewise If cdnjs.com also has a similar api it would be really useful
I think you misunderstand what I mean by tracking here -- we do not actively track any metrics on requests that are made to cdnjs in a way that makes data available to us for an API endpoint, including request count.
By the domain going through Cloudflare, they have basic request information logged and we could potentially use that to power an API endpoint to get hits for a library over a time period, but we do not currently have access to that data other than through manual requests that we make once a month for cdnjs/cf-stats.
I defer to @xtuc on if they think it'd be viable to get real-time access to Cloudflare data for an API endpoint, or if it'd be worth the investment to add our own request logging as middleware in a Worker, or if we should just continue to not offer an API endpoint for hits?
Activity
MattIPv4 commentedon Apr 23, 2021
👋 The short answer is that we don't have this data available in the API currently as we avoid doing tracking wherever possible.
@xtuc thoughts on if we can get this data made available in the API?
MattIPv4 commentedon Apr 23, 2021
We do not have access to hit data in the API, we do not actively track requests through any cdnjs operations.
The only place that this data will exist currently is within Cloudflare's standard logging system.
MattIPv4 commentedon Apr 23, 2021
I think you misunderstand what I mean by tracking here -- we do not actively track any metrics on requests that are made to cdnjs in a way that makes data available to us for an API endpoint, including request count.
By the domain going through Cloudflare, they have basic request information logged and we could potentially use that to power an API endpoint to get hits for a library over a time period, but we do not currently have access to that data other than through manual requests that we make once a month for cdnjs/cf-stats.
I defer to @xtuc on if they think it'd be viable to get real-time access to Cloudflare data for an API endpoint, or if it'd be worth the investment to add our own request logging as middleware in a Worker, or if we should just continue to not offer an API endpoint for hits?
Explosion-Scratch commentedon Jun 30, 2021
I would only be comfortable if all the data was anonymous, and then somehow opt-outable? (Not sure how that would work but it's something to consider)
MattIPv4 commentedon Jun 30, 2021
All the data we publish will always be anonymized and aggregated :)
I'm not sure how opt-out would function in this context?
Explosion-Scratch commentedon Jun 30, 2021
Possibly
noreferreror something in script tags could be taken as indication the script doesn't count? This could be done server side as well.MattIPv4 commentedon Jun 30, 2021
We already set noreferrer on all cdnjs script/link tags -- we don't track anything like that, we just track a total request count for each asset