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

Rainer Duffner rainer at ultra-secure.de
Tue Feb 14 19:16:24 UTC 2017


> Am 14.02.2017 um 20:10 schrieb Ebayer Ebayer <ebaystardust at gmail.com>:
> 
> 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.

https://www.nginx.com/blog/nginx-and-netflix-contribute-new-sendfile2-to-freebsd/ <https://www.nginx.com/blog/nginx-and-netflix-contribute-new-sendfile2-to-freebsd/>


Also take a look at

https://calomel.org/nginx.html <https://calomel.org/nginx.html>




Rainer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170214/d602a01c/attachment.html>


More information about the nginx mailing list