Giter Site home page Giter Site logo

Confirm recency about api HOT 6 CLOSED

jsdelivr avatar jsdelivr commented on May 24, 2024
Confirm recency

from api.

Comments (6)

tomByrer avatar tomByrer commented on May 24, 2024

The index file http://api.jsdelivr.com/v1/jsdelivr/ shows all included CDNs.

I don't see it here:

{
  "libraries": {
    "name": {
      "type": "String"
    },
    "zip": {
      "type": "String"
    },
    "mainfile": {
      "type": "String"
    },
    "mainfile2": {
      "type": "String"
    },
    "lastversion": {
      "type": "String"
    },
    "description": {
      "type": "String"
    },
    "homepage": {
      "type": "String"
    },
    "github": {
      "type": "String"
    },
    "author": {
      "type": "String"
    },
    "versions": {},
    "assets": {
      "type": "Mixed"
    },
    "created": {
      "type": "Date"
    }
  }
}

date the the data files were last updated

Good idea! Perhaps with v2 when we can get all CDN info in one giant JSON file?

Workaround: There is a created field in each project. For example:
http://api.jsdelivr.com/v1/bootstrap/libraries/twitter-bootstrap
http://api.jsdelivr.com/v1/jsdelivr/libraries/bootstrap
I assume that is when the last written scan of the CDN's project was. (I assume you are looking for how recent the entire CDN data is?)
Does not mean that CDN has the latest version of the file. For example, I've seen Google's CDN be 3 days late with a jQuery update due to it coming on a Friday afternoon before a 3-day US holiday, while CDNJS had it in hours. So Google was up to v1.7.2 when CDNJS had v1.8.0

Workaround-workaround: jsDelivr has version aliasing. Unofficially we don't recommend latest since an API change can automatically break something. But a point release alias is considered safe since they're normally small fixes & tweaks. EG: //cdn.jsdelivr.net/bootstrap/3.2/js/bootstrap.js will serve v3.2.0 now, & the bugfix v3.2.1 if/when released.

from api.

jimaek avatar jimaek commented on May 24, 2024

@UnbounDev Can we add this data? How often do we purge the CDN? If this data stays cached then it will be useless and no point adding it in the first place

from api.

UnbounDev avatar UnbounDev commented on May 24, 2024

The lokijs db we're using includes a meta field, e.g.

// http://api.jsdelivr.com/v1/jsDelivr/libraries/imagesloaded
// =>
{
...,
"meta": {
  "revision": 35,
  "created": 1433183937543,
  "version": 0,
  "updated": 1433204947949
},
"$loki": 465
}

where created/updated are timestamps relating to when that particular project was initalized/updated w/i the api - is that sufficient or is it desirable to have a 'master' meta file?

from api.

jimaek avatar jimaek commented on May 24, 2024

Yes but how often do we purge the CDN cache?

from api.

UnbounDev avatar UnbounDev commented on May 24, 2024

@jimaek after each sync cycle (~10 minutes)

from api.

jimaek avatar jimaek commented on May 24, 2024

Hmm then I guess this issue is fixed. @UnbounDev Can you note somewhere to make sure we document this feature?

from api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.