Follow

Should I serve my file myself or via CDN?

With the SDK for the Web, you have two options for how the end customer gets the library.

(1) You can download the file from the npm registry, and serve this file from your servers. 

(2) Alternatively, you can serve the file via CDN.  JSdeliver and unpckg are two services that serve all npm packages, including Scandit's. 

With each approach, there are tradeoffs.

Serving the file yourself means that you have full control over the availability of the library.  Additionally, most CDN services do not offer compression.  Depending on where you self-host things it may be faster because the browser requests the assets from the same server instead of self-hosted-website server + CDN server separately.

Serving the file via CDN allows you to either incorporate the latest library or to specify a version.  We recommend always specifying a version of the library, which means that your application won't be impacted by any changes we make (especially breaking changes).

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request