3rd Party Hosting Webflow Sites & Files

Hosting Code on CDN

Overview
What Does Webflow's Hosting Provide?
001
Hosting Sites
Hosting Sites
200
Exporting a Site
201
Reverse Proxy
202
Hosting Files
Hosting Files
600
Hosting Files on Google Drive
601
Hosting Files in Dropbox
602
Hosting Code
Hosting Client-side JavaScript Code
700
Hosting Editable Content & Data
Hosting Editable Content & Data
800
Hosting Data Using Google Sheets
801
Google Docs
Hosting Data Using Google Docs
850
In-Directly Embedding Content from Google Docs
851
Directly Embedding Formatted Content from Google Docs
852
Hosting on CDNs
Hosting Code on CDN
900
Dev & Build Process
901
No items found.
Published
July 16, 2023
Updated
July 16, 2023
in lightbox

Hosting Code on a CDN

The best approach is often to host on GitHub.

Limitations

Typically the GitHub repo must be public.

Exceptions- Netlify

Options

There are several popular options for hosting a JavaScript library on a Content Delivery Network (CDN). Here are a few of the best ones:

  1. jsDelivr: jsDelivr is a free, open-source CDN that is specifically designed for hosting JavaScript libraries and other static assets. It integrates with npm and GitHub, which makes it easy to host and update your library. It also has a robust network with multiple POPs (Points of Presence) around the globe.
  2. CDNJS: This is a community-driven CDN that hosts a large number of JavaScript libraries. It's free and easy to use, with a simple API and integration with many popular libraries.
  3. unpkg: unpkg is a fast, global CDN for any file in the npm registry. It's a great option if your library is published on npm. Simply append your package name to the unpkg URL, and it will serve the package's main file directly.
  4. Google Hosted Libraries: Google provides a CDN service for many popular open-source JavaScript libraries. While it doesn't allow you to host your own custom library, it's a good option if you're using any of the libraries they host.
  5. Microsoft Ajax CDN: Similar to Google's CDN, Microsoft Ajax CDN hosts many popular JavaScript libraries. It doesn't allow custom library hosting but is a good option for the libraries it does host.
  6. AWS CloudFront: If you're already using AWS, CloudFront can be a good option. It's not free, but it has many advanced features, like the ability to use your own domain name, HTTPS, and detailed analytics.

Remember that while using a CDN can greatly improve the speed of your library for end-users, it's also important to maintain a local copy of your library as a fallback, in case the CDN fails or is slow to update.

Private Repo Options

CDNs typically serve static files that are publicly accessible, which doesn't work well with private repositories because the contents of a private repository are not visible to the public. However, you can host your JavaScript library on a private GitHub repository and use a combination of build processes and other services to deliver the built assets to a CDN.

Here are a few steps you could take:

  1. Build process: Set up a build process that runs whenever you push changes to your private GitHub repository. This could be accomplished with GitHub Actions or another continuous integration service. The build process would compile your JavaScript library into a version suitable for use in a browser.
  2. Amazon S3 and CloudFront: You could configure your build process to upload the built assets to a private Amazon S3 bucket. Then you could use Amazon CloudFront, which is a CDN, to serve your assets from the S3 bucket. S3 allows you to store the files and CloudFront allows you to deliver the files efficiently to users. Both services are part of AWS and are not free, but they offer a high level of control and integration with other AWS services.
  3. Netlify or Vercel: These are cloud platforms that can build your project directly from your private GitHub repository and serve the built assets over their CDNs. They offer both free and paid plans and can be a good choice if you want a simple, all-in-one solution.

Please note that serving static files from a private repository would require some sort of access control and it might not be as straightforward as serving them from a public repository. Always ensure that you are not unintentionally exposing sensitive information when hosting code or assets.

Videos
No items found.
Table of Contents
Comments
Did we just make your life better?
Passion drives our long hours and late nights supporting the Webflow community. Click the button to show your love.