News for hackers. Stuff that matters.

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

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?

( 11 comments | 3 points | on HN )
Re:Ask HN: Where do you store images for your static site? by sgbeal on Sunday July 21, 2024 @01:53AM (#41022740)
> 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.

Re:Ask HN: Where do you store images for your static site? by jskherman on Sunday July 21, 2024 @01:57AM (#41022757)
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.
Re:Ask HN: Where do you store images for your static site? by sgbeal on Sunday July 21, 2024 @06:32PM (#41028877)
> From what I read and experienced, it makes the size of the Git repository much bigger than it should be...

Of course, it's a trade-off, but how is that particular one more painful than being at the whims of (and paying for) a third-party provider for something as mundane as static image files?

Re:Ask HN: Where do you store images for your static site? by OhMeadhbh on Sunday July 21, 2024 @01:15AM (#41022554)
as data uris. the whole static site is on one of a couple different CDNs depending on region.
Re:Ask HN: Where do you store images for your static site? by jskherman on Sunday July 21, 2024 @01:20AM (#41022580)
Like encoded base64 and using a post-processor to convert the images?
Re:Ask HN: Where do you store images for your static site? by OhMeadhbh on Sunday July 21, 2024 @02:17AM (#41022851)
yup. also, i've started denoising and converting images to avifs. amazeballs compression. sometimes denoising introduces artifacts in the "whatever" to AVIF conversion, so ymmv.
Re:Ask HN: Where do you store images for your static site? by cuu508 on Sunday July 21, 2024 @01:27AM (#41022624)
Together with the static site, in /img/ directory next to the html files.
Re:Ask HN: Where do you store images for your static site? by h2odragon on Sunday July 21, 2024 @07:18AM (#41024251)
i've always used /art/
Re:Ask HN: Where do you store images for your static site? by pestatije on Sunday July 21, 2024 @01:29AM (#41022639)
im using Cloudflare for my static content (includes images)
Re:Ask HN: Where do you store images for your static site? by jskherman on Sunday July 21, 2024 @01:38AM (#41022679)
I see. I considered doing a static site dedicated to images on Cloudflare Pages and hotlinking from there. According to the docs[1], Cloudflare Pages projects support up to 20000 files.

[1]: https://developers.cloudflare.com/pages/platform/limits/

Re:Ask HN: Where do you store images for your static site? by ritagreg on Sunday July 21, 2024 @01:23AM (#41022602)
Do not ignore this message even if its off topic, i decided to do this at this chance. a lot of people now hack and deactivate our social apps through mere links, i was a victim till my husband found this man who we reached through bohdanbohdan93 AT mail ru for help and he recovered my accounts. they are very rare to find