- Local time
- Oct 5, 2019
because of a downtime of Image cache & resize service today I've checked alternatives (except paying thousands of dollars for Cloudinary, Imgix ...).
After some research I've found h2non/imaginary which does everything I want.
So I've booted a 3€/month VPS on Truly thrifty cloud hosting - Hetzner Online GmbH and installed it - result: works like a charm.
So I started playing around, added a list of allowed URLs, configured Cloudflare CDN via page rules and now I have a blazing fast image manipulation CDN which has a whitelist of domains, uses signed URLs to prevent user manipulation and the worlds best (free) CDN infront of it - which also adds SSL without any letsencrypt or whatever.
Hetzner Cloud is super easy to setup, the servers are pretty fast and the price is unbeatable.
Imaginary has a not perfect HTTP API, but I will build a PHP fluent URL builder like my Astrotomic/php-weserv-images before. Except of this the library is outstanding. The support of URL retrieving and all the security features are perfect to setup a public image CDN service limited to a set of domains.
The major benefit for me: I have a single service which will handle all my pages and every page can use it's own CDN url. All my pages are on Cloudflare already - so I only have to add an A-record and a page rule:
https://imaginary.example.com/* SSL: Flexible Browser Cache TTL: a month Cache Level: Cache Everything Edge Cache TTL: a month
And because Cloudflare does all the CDN and caching stuff I don't have to care about it - don't have to provide/pay for any storage to cache.