How to cache static files under root /var/www/html/images

Rainer Duffner rainer at
Tue Feb 14 19:16:24 UTC 2017

> Am 14.02.2017 um 20:10 schrieb Ebayer Ebayer <ebaystardust at>:
> Hi,
> I have Nginx running as a webserver (not as proxy). I need to cache static files that are under /var/www/html/images in memory. What's the simplest way to do this?

Your OS does that for you.

That’s why it does not make sense to cache it again and why there’s no point in running varnish on local files.

AFAIK, you can get a speed-increase if you have either FreeBSD+ZFS+AIO compiled into NGINX or FreeBSD 11 + nginx 1.11, which uses a special sendfile implementation to maximize deliver-speed of local files. <>

Also take a look at <>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list