Skip to content

johnwaweru/web2img

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Web2Img

Web2Img is a tool to bundle your web files into a single image, and extract them via Service Worker at runtime.

You can use image hosting sites as free CDNs to save bandwidth costs.

intro.png

Tool

Try It Online: https://etherdream.github.io/web2img/

demo.mp4

Example

Demo: https://fanhtml5.github.io

Target Files: https://github.com/fanhtml5/fanhtml5.github.io (only 2 files)

Source Files: https://github.com/fanhtml5/test-site

FAQ

Q: Is free CDN safe?

A: Yes, the program will verify the data integrity.


Q: Is free CDN stable?

A: Not sure, but you can provide multiple URLs to improve stability.


Q: Can any free CDN be used?

A: No, CDN must enable CORS, allow empty referrer and "null" origin (or real value).


Q: Would it be better to optimize the image before uploading?

A: If the server will re-encode the image, it makes no difference.


Q: Why use 404.html?

A: It's an easy way to intercept any path.


Q: How to update files?

A: Just overwrite x.js, the client polls this file every 2 minutes.


Q: What if the browser doesn't support Service Worker?

A: Unfortunately, the page can't be displayed. You can add a fallback in 404.html.


Q: Will new features be added?

A: This project is just an experiment, there is a new project named freecdn which is much more powerful. (better docs will be released soon)

License

MIT

About

bundle web files into a single image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.3%
  • HTML 11.8%
  • CSS 3.9%