TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Where do you host images for your blog or landing pages?

35 pointsby akshaykumar90over 2 years ago
I am curious what are the current best practices and offerings for hosting images (or short videos, gifs, etc.) for small to mid scale websites?<p>Currently, I am using Cloudinary but the management interface leaves a lot to be desired. I have seen some static sites use GitHub repositories for hosting images which I think is a pretty cool hack.

37 comments

mattw2121over 2 years ago
I guess I&#x27;m behind the times, but I just store them on the file system where I am serving the website from.
评论 #33233085 未加载
评论 #33232913 未加载
marginalia_nuover 2 years ago
If you aren&#x27;t getting hundreds of requests per second, and the resources aren&#x27;t huge, there&#x27;s really no reason why you can&#x27;t host them yourself. Especially with webp, the bandwidth is negligible.<p>If you&#x27;re really worried, cloudflare can help with caching. FWIW, this is served off domestic broadband with cloudflare caching: <a href="https:&#x2F;&#x2F;search.marginalia.nu&#x2F;explore&#x2F;random" rel="nofollow">https:&#x2F;&#x2F;search.marginalia.nu&#x2F;explore&#x2F;random</a> It&#x27;s survived the HN front-page, despite being a bit of a pathological case since the images are random out of a pool of tens of thousands. Images are also larger than they appear visually. Native res is like this: <a href="https:&#x2F;&#x2F;search.marginalia.nu&#x2F;screenshot&#x2F;187889" rel="nofollow">https:&#x2F;&#x2F;search.marginalia.nu&#x2F;screenshot&#x2F;187889</a>
chrismorganover 2 years ago
In the same place. Why anything else? <i>Much</i> simpler, and no extra HTTPS connection to make, and probably within ε on file delivery performance (though that’s heavily subjective). There’s almost never any reason to do it any other way.
gh123manover 2 years ago
You can go surprisingly far with a $5&#x2F;mo Digital Ocean droplet and the Cloudflare free tier. Just host your website the boring way, put CF in front of it and they will cache and serve all of your static content for free.
评论 #33233183 未加载
评论 #33234332 未加载
评论 #33233307 未加载
评论 #33233255 未加载
colbyfayockover 2 years ago
Colby from Cloudinary here what framework &#x2F; tooling are you using? Sorry you haven&#x27;t had a great experience with the UI, but if you stick around with Cloudinary, I would suspect there&#x27;s a lot of solutions where the processing &#x2F; uploading can be automated, such as using a Cloudinary plugin within a headless CMS (like Contentful) where you just use a URL or plugins like the Gatsby plugin: <a href="https:&#x2F;&#x2F;github.com&#x2F;cloudinary-devs&#x2F;gatsby-transformer-cloudinary" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cloudinary-devs&#x2F;gatsby-transformer-cloudi...</a> (only supports images so far)<p>If you&#x27;re on the Netlify side of things, I have a plugin there that automates images <a href="https:&#x2F;&#x2F;github.com&#x2F;colbyfayock&#x2F;netlify-plugin-cloudinary&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;colbyfayock&#x2F;netlify-plugin-cloudinary&#x2F;</a><p>There&#x27;s a ton others too: <a href="https:&#x2F;&#x2F;cloudinary.com&#x2F;documentation&#x2F;cms_ecommerce_integrations" rel="nofollow">https:&#x2F;&#x2F;cloudinary.com&#x2F;documentation&#x2F;cms_ecommerce_integrati...</a> <a href="https:&#x2F;&#x2F;cloudinary.com&#x2F;documentation&#x2F;partner_built" rel="nofollow">https:&#x2F;&#x2F;cloudinary.com&#x2F;documentation&#x2F;partner_built</a><p>Hope that helps, happy to brainstorm other ideas as well!
janewayover 2 years ago
The image is placed in my website directory and then my static site generator, jekyll, uses a relative path tag to generate the path for the final compiled website on my machine. This static website is then uploaded to github. If I was uploading elsewhere, the workflow would be the same. Only the relative path is hardcoded and the domain therefore doesn’t matter. The true filepath is to some github link in my “_site” directory, but neither I nor the user see it. Static sites are very easy to manage in this way.
pocketsandover 2 years ago
S3 has no minimum fee. For a small site they&#x27;ll probably send you a 4 cent invoice each month. You can then throw cloudflare in front of the S3 box for free.<p>Alternatively, as others have said, you can just plop them on the server and call it a day.
评论 #33233591 未加载
0xbadcafebeeover 2 years ago
GitHub Pages works for non-commercial purposes. You get 1GB to serve and max file size is 100MB. Soft bandwidth limit 100GB&#x2F;month, with some rate limiting. Best to put CloudFlare in front (actually I can&#x27;t get CloudFlare to work with Google Pages, their cache never expires so no new pages show up through CloudFlare)<p>CloudFlare Pages (<a href="https:&#x2F;&#x2F;pages.cloudflare.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pages.cloudflare.com&#x2F;</a>) has a free plan with 100 sites, unlimited requests, unlimited bandwidth. Maximum file size 25MB, 20,000 files, 100 domains, 100 custom headers, 2,000 static redirects, 100 dynamic redirects. (<a href="https:&#x2F;&#x2F;developers.cloudflare.com&#x2F;pages&#x2F;platform&#x2F;limits&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developers.cloudflare.com&#x2F;pages&#x2F;platform&#x2F;limits&#x2F;</a>) Unknown if there&#x27;s a commercial restriction.
评论 #33234148 未加载
brycewrayover 2 years ago
Have done both “local” (site host) and Cloudinary. With static sites in particular, a lot of it depends on your preferred site-building tool. The Hugo static site generator does a pretty impressive job of managing and processing images out of the box while, with most other SSGs, you’ll need to wrangle plugins and packages and you won’t get the same high performance. Thus, apart from Hugo sites, Cloudinary may end up being a better solution — although you’re right about its UI, and I’d say the same thing about its documentation. Even if you do use Hugo, it may be better to go with Cloudinary so you can avoid having to keep a lot of images in the site repo.
cheptsovover 2 years ago
Just curious, what do you use for hosting the blog or landing page itself?<p>For example, we use GitHub Pages for hosting the landing page. So for hosting images, we use GitHub itself and it mostly works.<p>For the blog, we currently use Substack, but thinking of maybe moving it to GitHub Pages too.<p>FYI, here is our repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;dstackai&#x2F;dstack" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dstackai&#x2F;dstack</a>
jasodeover 2 years ago
Some meta-commentary about some of the replies ... so far, there are 4+ replies suggesting the obvious step of storing in the images on the same web server host. But I notice the submitter is software engineer ex-Stripe, ex-Yelp, ex-Adobe... so I&#x27;m guessing he already knows that simple setup but doesn&#x27;t locally host gifs &amp; vids for technical reasons (bandwidth?, latency?).<p>Maybe recalibrate the suggestions based on the above. (Or the submitter can further clarify why hosting local image assets instead of using a CDN is not feasible in his particular case so the crowdsourced answers can be more productive to his goals.)<p>EDIT add: Sure, obvious technical answer may be applicable but some replies have a bit of condescension that doesn&#x27;t seem appropriate and respectful of this person&#x27;s tech background.
评论 #33233234 未加载
评论 #33233269 未加载
评论 #33233350 未加载
subpixelover 2 years ago
I have an entire repo set up to share images via iPic - I just select an image locally and with a keyboard command updload it and add the url to my clipboard<p><a href="https:&#x2F;&#x2F;github.com&#x2F;toolinbox&#x2F;iPic" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;toolinbox&#x2F;iPic</a>
Archelaosover 2 years ago
My own Web-site is mostly static, so images (I don&#x27;t use video) are in the file system. For customer&#x27;s it is sometimes more complex: The setup of dynamic Web-site content happens in a database application. The images are stored in their raw format in a database and transfered to the file system of the Web-site in the right dimensions and scale when their associated data-set (such as a specific product information, etc.) is to be published. This makes it easy to reuse the images in other contexts, e.g. PDFs, or to adapt to changes in the Web-site layout, e.g. low resolution&#x2F;high compression for mobile.
beemaestroover 2 years ago
Okay this might be an overkill but my images are on CloudFront. I store them in S3, which get served through the CDN. It’s practically free at my scale. The actual blog is a GitHub pages site.
tyingqover 2 years ago
&gt;use GitHub repositories for hosting images<p>I don&#x27;t know the current state of doing this, but it has been problematic in the past because they don&#x27;t return the right content-type headers.
Aprecheover 2 years ago
That depends.<p>Some files are files that are part of the web site. They are put there by the developer(s) of the web site. Things like maybe the logo image in the header, or that cool rotating flaming skull in the footer. These files just go on the file system of the web server.<p>Some files are user uploads. A person writing a blog post wants to upload some images to be inserted into that blog post. For these sorts of files I just use whatever object storage system makes the most sense given the circumstances S3, GCS, etc.
madmax108over 2 years ago
Simple hack for one-off (or a few) images. Go to any Github repo and create a new Issue, drag and drop your image into the issue-box. Github uploads it to their server and adds a markdown link for the image, which has a perfectly usable *.githubusercontent.com url that you can pick and use anywhere.<p>I use this way more often than I should TBH. YMMV<p>Note: Only do this for images you have backed up elsewhere (heck, in git itself is fine). This is purely to prevent having to spend any $$$ on hosting&#x2F;CDN whatever
ianpurtonover 2 years ago
I commit to a github repo and that gets deployed to cloudflare pages. <a href="https:&#x2F;&#x2F;pages.cloudflare.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pages.cloudflare.com&#x2F;</a><p>I use Zola the static site generator. My repo is here <a href="https:&#x2F;&#x2F;github.com&#x2F;purton-tech&#x2F;cloak&#x2F;tree&#x2F;main&#x2F;www" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;purton-tech&#x2F;cloak&#x2F;tree&#x2F;main&#x2F;www</a>
D13Fdover 2 years ago
I do Amazon S3. Not because I have any particular love for Amazon, but because it was the default in the original template I used, and it was easy to set up and almost free. It has worked well. Most months I&#x27;m under the free tier usage limit, and the largest bill I&#x27;ve seen so far was less than $5.<p>My hosting provider (Render) requires an add-on for file storage, so last I checked AWS S3 free tier was the cheaper option.
HHalviover 2 years ago
I have been super impressed by the latency of the images hosted on Imagekit. Used to host images on Cloudinary, found Imagekit to be faster for my visitors + more affordable. I currently have 2 accounts with them, one for my personal website&#x2F;blog on free tier and a paid tier for landing pages for my employer. Highly recommend them, no affiliations, just a super happy customer!
labarilemover 2 years ago
My blog is built on Github pages. I don&#x27;t have lots of images, so they&#x27;re hosted in the same repo of my website.
Trufaover 2 years ago
It’s probably not the cool answer but aws s3.
Alchaover 2 years ago
I use [DigitalOcean Spaces](<a href="https:&#x2F;&#x2F;www.digitalocean.com&#x2F;products&#x2F;spaces" rel="nofollow">https:&#x2F;&#x2F;www.digitalocean.com&#x2F;products&#x2F;spaces</a>) with a custom domain fronting the assets. It&#x27;s fairly cheap and easy to use.
iamflimflam1over 2 years ago
My site is generated by Jekyll and then I just sync to S3 and serve it all through CloudFront - works pretty well <a href="https:&#x2F;&#x2F;atomic14.com" rel="nofollow">https:&#x2F;&#x2F;atomic14.com</a>
a6chrisover 2 years ago
Your title mentions blogs - if you use self hosted WordPress and their Jetpack plugin (free), you get to use their CDN for free and seamlessly. Likely this is also already the case for WP.com
taubekover 2 years ago
When it comes to GitHub repo, what does the URL of the image look like? Is some kind of hash added to the filename? At the moment I use media files from my WordPress blog to store images.
评论 #33232856 未加载
评论 #33233185 未加载
ochronusover 2 years ago
On the same server, my Ghost instance manages it. I have Cloudflare before it all. I wish I&#x27;d get to outgrow this setup
dreenover 2 years ago
I just commit them to the git lfs (in my case via netlify). Larger sites benefit from actual asset management systems though.
demindiroover 2 years ago
I scp them to some folder on my VPS and point nginx to it.<p>I also have ffmpeg installed on the VPS if some images are too big for my taste.
gitgudover 2 years ago
I use imgur most of the time, it&#x27;s super simple and hasn&#x27;t failed me yet
egamirorrimover 2 years ago
Check out upload.io - it was a refreshingly simple take on Cloudinary etc for me
评论 #33275480 未加载
qudatover 2 years ago
for <a href="https:&#x2F;&#x2F;prose.sh" rel="nofollow">https:&#x2F;&#x2F;prose.sh</a> we use <a href="https:&#x2F;&#x2F;imgs.sh" rel="nofollow">https:&#x2F;&#x2F;imgs.sh</a>
sidcoolover 2 years ago
Scene7 or Cloudflare or AWS Cloudfront.
pkruminsover 2 years ago
On the blockchain of course!
orangepurpleover 2 years ago
Vultr object storage
BurningPenguinover 2 years ago
On the same server i have my website on. It&#x27;s easy to implement and i don&#x27;t have headaches due to GDPR. Performance is good, if it&#x27;s properly optimized. I also add Hotwire Turbo if necessary.
g5095over 2 years ago
On GH :)