I’ve gone ahead and turned on Varnish caching for my assets
directory, using a slightly modified version of @richp10’s config:
# Cache only the static assets in Discourse's "assets" dir and pass everything else
if (req.http.host ~"discourse.bigdinosaur.org") {
if (!(req.url ~ "^/assets/")) {
return (pass);
}
}
This is a hell of a lot more convenient for me than dealing with a CDN, since I’m already using Varnish on the web server. Plus, there’s quite a bit of stuff in there; keeping the static assets in Varnish will ensure that they’re accessed from RAM instead of having to push IO down onto the disk.
I’m not anticipating a massive performance increase or anything, but it seems like just a smart thing to do.