I have Nginx running in a Docker container and it is serving some static files. Files will not change at run time - if they do change, the container will be stopped, the image will be rebuilt, and a new container will be launched.
So, to improve performance, it would be ideal if Nginx reads static files only once from disk, and then forever stores it from memory. I found some configuration options for configuring caching, but at least from what I saw, none of them provided this “forever” behavior that I am looking for.
Is this even possible? If so, how do I need to configure Nginx for this?
source
share