O'Reilly logo

Nginx HTTP Server - Fourth Edition by Clement Nedelcu, Martin Fjordvald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

FastCGI caching and buffering

Once you have correctly configured Nginx to work with your FastCGI application, you may optionally make use of the following directives, which will help you improve the overall server performance by setting up a cache system. Additionally, FastCGI buffering allows you to buffer responses from the FastCGI backend instead of synchronously forwarding them to the client:

Directive

Description

fastcgi_cache

Context: http, server, location

This directive defines a cache zone. The identifier given to the zone is to be reused in further directives.

Syntax: fastcgi_cache zonename;

Example: fastcgi_cache cache1;

fastcgi_cache_key

Context: http, server, location

This directive defines the cache key

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required