Skip to content

Instantly share code, notes, and snippets.

@jcubic
Last active March 19, 2024 02:43
Show Gist options
  • Star 30 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jcubic/a8b8c979d200ffde13cc08505f7a6436 to your computer and use it in GitHub Desktop.
Save jcubic/a8b8c979d200ffde13cc08505f7a6436 to your computer and use it in GitHub Desktop.
How to setup a literally free CDN
@3kh0
Copy link

3kh0 commented Feb 5, 2023

@proudparrot2
Copy link

Add gitloaf: https://gitloaf.com

@lopugit
Copy link

lopugit commented Jan 11, 2024

Wow this is so cool πŸ’―πŸ™πŸ™ŒπŸš€πŸ‘¨β€πŸ’»

@lopugit
Copy link

lopugit commented Jan 11, 2024

Would be great if there was a way to do cache busted @latest..

@jcubic
Copy link
Author

jcubic commented Jan 11, 2024

@lopugit there is an option to purge the URL for jsDelivr, but it doesn't work all the time. Just Replace the "cdn" with "purge".

You can try to add a GitHub action that will purge the URL. But it may break, it's better to do this manually. There is also an option to use git commit hash so you will always have the latest version.

@lopugit
Copy link

lopugit commented Feb 13, 2024

@jcubic oh awesome! πŸ™

Man, thank you so much for making this gist, this github -> cdn thing has helped me so much, if you use babel standalone, you can basically create full React typescript apps and make them embeddable using just <script src , combined with importing esm modules via esm cdn, it's incredible

          await loadScript("https://unpkg.com/@babel/standalone/babel.min.js", "text/javascript")
          
          await loadScript({ content: `
          
            import React from "https://esm.sh/react@18";
            window.React = React

Take a look here for example.

https://github.com/lopugit/mods/blob/v1.0.16/maccas.js

@jcubic
Copy link
Author

jcubic commented Feb 13, 2024

@lopugit I don't understand what your code is supposed to do, but I'm glad that you find my gist useful.

@lopugit
Copy link

lopugit commented Feb 13, 2024

@jcubic πŸ˜‚ πŸ™ πŸ’― πŸš€ πŸ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment