* recover middleware * simplify Atoi * metadata data prototype * InterestingAttention * resize itself * Bump version to 0.9.4 Added some comments Removed String() for Extraparams * Add metadata test * Fix CI * Remove unnecessary tests * Update file count * use t.Run to get test case --------- Co-authored-by: n0vad3v <n0vad3v@riseup.net>
This is a Server based on Golang, which allows you to serve WebP images on the fly.
- currently supported image format: JPEG, PNG, BMP, GIF
e.g When you visit
https://your.website/pics/tsuki.jpg
,it will serve asimage/webp
format without changing the URL.
For Safari and Opera users, the original image will be used.We've now supported Safari/Chrome/Firefox on iOS 14/iPadOS 14
Usage with Docker(recommended)
We strongly recommend using Docker to run WebP Server Go because running it directly with the binary may encounter issues with glibc
and some dependency libraries, which can be quite tricky to resolve.
Make sure you've got Docker and docker-compose
installed, create a directory and create docker-compose.yml
file inside it like this:
version: '3'
services:
webp:
image: webpsh/webp-server-go
# image: ghcr.io/webp-sh/webp_server_go
restart: always
environment:
- MALLOC_ARENA_MAX=1
volumes:
- ./path/to/pics:/opt/pics
- ./exhaust:/opt/exhaust
ports:
- 127.0.0.1:3333:3333
Suppose your website and image has the following pattern.
Image Path | Website Path |
---|---|
/var/www/img.webp.sh/path/tsuki.jpg |
https://img.webp.sh/path/tsuki.jpg |
Then
./path/to/pics
should be changed to/var/www/img.webp.sh
./exhaust
is cache folder for output images, by default it will be inexhaust
directory alongside withdocker-compose.yml
file, if you'd like to keep cached images in another folder as , you can change./exhaust
to/some/other/path/to/exhaust
Start the container using:
docker-compose up -d
Now the server should be running on 127.0.0.1:3333
, visiting http://127.0.0.1:3333/path/tsuki.jpg
will see the optimized version of /var/www/img.webp.sh/path/tsuki.jpg
, you can now add reverse proxy to make it public, for example, let Nginx to proxy_pass http://127.0.0.1:3333/;
, and your WebP Server is on-the-fly!
You can refer to Docker | WebP Server Documentation for more info, such as custom config, AVIF support etc.
Advanced Usage
If you'd like to use with binary, please consult to Basic Usage | WebP Server Documentation, spoiler alert: you may encounter issues with glibc
and some dependency libraries.
For supervisor or detailed Nginx configuration, please read our documentation at https://docs.webp.sh/
WebP Cloud Services
We are currently building a new service called WebP Cloud Services, it now has two services:
- Public Service
- GitHub Avatar/Gravater reverse proxy with WebP optimization, for example, change
https://www.gravatar.com/avatar/09eba3a443a7ea91cf818f6b27607d66
tohttps://gravatar.webp.se/avatar/09eba3a443a7ea91cf818f6b27607d66
for rendering will get a smaller version of gravater, making your website faster - Totally free service and currently has a large number of users, this includes, but is not limited to CNX Software,Indienova
- GitHub Avatar/Gravater reverse proxy with WebP optimization, for example, change
- WebP Cloud
- No need to install WebP Server Go, especially suitable for static websites.
- Image Conversion: WebP Cloud converts images to WebP format, reducing size while maintaining quality for faster website loading.
- Example: Original image URL (https://yyets.dmesg.app/api/user/avatar/Benny) becomes compressed URL (https://vz4w427.webp.ee/api/user/avatar/Benny).
- Caching: WebP Cloud automatically caches served images, reducing traffic and bandwidth load on the origin server.
For detailed information, please visit WebP Cloud Services Website or WebP Cloud Services Docs.
Support us
If you find this project useful, please consider supporting us by becoming a sponsor, pay via Stripe, or try out our WebP Cloud!
USD(Card, Apple Pay and Google Pay) | EUR(Card, Apple Pay and Google Pay) | CNY(Card, Apple Pay, Google Pay and Alipay) |
---|---|---|
USD | EUR | CNY |
![]() |
![]() |
![]() |
License
WebP Server is under the GPLv3. See the LICENSE file for details.