Easily enable the NGINX cache.
dokku plugin:install https://github.com/kvandake/dokku-nginx-cache.git nginx-cache
To validate if it is working you can simply check the X-Cache-Status
. You can
that easily with curl
from the command line:
$ curl -I http://YOURAMAZINAPP.DOMAIN.EXT/
You can validate it by running it multiple times, and after the first time it will show something like:
X-Cache-Status: HIT
Enable nginx caching
$ dokku nginx:cache:enable MYAPP
Disable nginx cache for your app
$ dokku nginx:cache:disable MYAPP
Currently there are no configuration options. However, Nginx does obey a number of caching- and X-Accel-*
-related headers.
You can always play around by editing directly the file in /etc/nginx/conf.d/dokku-cache.conf
Snippet from nginx docs:
X-Accel-Expires
,Expires
,Cache-Control
,Set-Cookie
, andVary
set the parameters of response caching;X-Accel-Redirect
performs an internal redirect to the specified URI;X-Accel-Limit-Rate
sets the rate limit for transmission of a response to a client;X-Accel-Buffering
enables or disables buffering of a response;X-Accel-Charset
sets the desired charset of a response.