top | item 41022525

Ask HN: Where do you store images for your static site?

3 points| jskherman | 1 year ago

I'm currently using Zola as my static site generator and I'm looking into ways to store and serve images from. There are options like Cloudflare's R2 (S3-compatible), Cloudinary, or even a site dedicated to images and hotlinking to there. God forbid that the solution is committing binary images to the Git repository.

Do you have any recommendations that are portable (e.g. easy to switch vendors) and inexpensive, preferably free at the start?

10 comments

order

sgbeal|1 year ago

> God forbid that the solution is committing binary images to the Git repository.

Where does the misconception that that's somehow a problem stem from? In 30 years of having web sites, that approach has invariably served me well.

jskherman|1 year ago

From what I read and experienced, it makes the size of the Git repository much bigger than it should be with how Git tries to keep copies of old binary files (specifically the data and hash) since it cannot diff those unlike plaintext. You eventually have cache of the old files in the repo if you're not deliberate with setting --depth when cloning.

cuu508|1 year ago

Together with the static site, in /img/ directory next to the html files.

h2odragon|1 year ago

i've always used /art/

OhMeadhbh|1 year ago

as data uris. the whole static site is on one of a couple different CDNs depending on region.

jskherman|1 year ago

Like encoded base64 and using a post-processor to convert the images?