HACKER Q&A
📣 diceduckmonk

Where do you host your CSS files?


We currently have a web app hosted on the cloud. The HTTP server does server-side rendering, including serving up static CSS and SVG files.

For reasons, the web server framework doesn't support caching out-of-the-box and we hand-roll our own.

I thought we might as well complexify our deployment step instead and reap some performance benefits. Immediately, I thought to use Amazon S3 for the CSS files. Does any one else do this? Is there something lower latency than S3?


  👤 theandrewbailey Accepted Answer ✓
Same host and same domain.

Moving to another domain/host will incur additional latency on page load times.


👤 FastEatSlow
Caching should be handled by the proxy in front of your server in that case. Adding another host is unlikely to improve performance, especially with HTTP/2.

👤 leros
I host all statics (JavaScript, css, images, etc) from the same CDN host.

I've used various options over the years. Cloudflare Pages, Netlify, Firebase Hosting, etc. They're all fine.

If you're in AWS land already, Cloudfront is Amazon's CDN and it's a great solution too. Cloudfront specifically can sit in front of S3 buckets so that assets get cached.


👤 danwee
Usually on the server where nginx is installed.

👤 guilherme-puida
`/static/styles.min.css` usually.