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

Francis Daly francis at daoine.org
Tue Feb 14 21:40:45 UTC 2017


On Tue, Feb 14, 2017 at 09:07:46PM +0000, Ebayer Ebayer wrote:

Hi there,

> I want to cache critical files indefinitely regardless of them being hot or
> stale until they're purged (by the app).

It still doesn't sound like a task for nginx to me.

If you want your OS file-cache to do busy-work to keep these files "hot",
do just that.

 while :; do
  find /var/www/html/images -type f -exec cat \{} > /dev/null +
  sleep 10
 done

I don't recommend it; but it's not my server.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list