Settings

Theme

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

3 points by jskherman a year ago · 11 comments · 1 min read


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?

sgbeal a 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.

  • jskhermanOP a 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.

    • sgbeal a year ago

      > 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?

cuu508 a year ago

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

OhMeadhbh a year ago

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

  • jskhermanOP a year ago

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

    • OhMeadhbh a year ago

      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.

pestatije a year ago

im using Cloudflare for my static content (includes images)

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection