Enable Content Caching

Learn how to enable content caching in NGINX as a Service for Azure

NGINX as a Service for Azure supports caching via the ngx_http_proxy_module module, improving performance by allowing content to be served from cache without having to contact upstream servers. For more information on caching with NGINX, see NGINX Content Caching.

Configuring caching

http {
    # ...
    proxy_cache_path /var/cache/nginx keys_zone=mycache:10m;
}

NGINXaaS for Azure only supports caching to /var/cache/nginx. This is because data at /var/cache/nginx will be stored in a separate Temporary Disk. The size of the temporary disk is 4GB.

Limitations

Currently, NGINXaaS for Azure disables the use of proxy_cache_purge because only one instance will receive a PURGE request. Cache can be stored on multiple instances, so some cache may not be purged.