The reverse Proxy is able to cache content in order to deliver it without need to forward connections to the next hope web server.
This feature increase dramatically your Web server performance because the front-end reverse proxy is able to serve web page without query your web servers.
To cache your web sites you need first to create caches containers, then affect caches containers to websites.
Create your first cache
- Select Caches tab.
- Click on New cache
- Give the name of your cache storage ( in our Example : BigCache )
- Set the directory where to store cached content
- Levels: is levels parameter sets the number of sub-directory levels in cache
- Memory size in MB : Was defining shared memory zone named “BigCache” in our example with maximum size 500 MB.
It holds all active keys and metadata of the cache.
Whenever reverse-proxy checks if a page was cached, it consults the shared memory zone first, then seek the location of actual cache in
Directoryif cache exist.
- Max Size (GB): Was maximum size of cache e.g. files size on Directory
- Inactive (in Minutes): Specify maximum inactive time cache can be stored.
Cached data that are not accessed during the time specified by the this parameter get removed from the cache regardless of their freshness.
More you set inactive, more the retention time will be increased.
- A special “cache loader” process is activated.
This process loads information about previously cached data stored on file system into a cache zone.
The loading is done in iterations.
During one iteration no more than “Max Files to Load” items are loaded (by default, 100).
Besides, the duration of one iteration is limited by the “Max time to load files ( Milliseconds) parameter (by default, 100 milliseconds).
Between iterations, a pause configured by the “Sleep between iteration” parameter (by default, 10 milliseconds) is made.
- Now your cache is ready to be linked to a “Destination” web site.
Affect the cache to a destination
Caches are affected to a destination not to your front-end configuration.
- Click on destinations tab.
- Choose your reversed web site.
- Select you cache in the “Caches directory” drop-down list.
- Click on Apply
- Cache is affected to your destination server.
- Click on Apply icon in order to make the cache in production mode.
Tweak cache performance.
You can better drive the cache performance per domain ( opposite of the destination server )
- On the Web site list, select your domain.
- Choose “Cache” tab.
Proxy Buffering Enables or disables buffering of responses from the proxied server. ( typically it enables or disabled cache capability)
When buffering is enabled, the reverse proxy receives a response from the proxied server as soon as possible, saving it into the buffers set by the Proxy Buffer size and Proxy buffers directives.
If the whole response does not fit into memory, a part of it can be saved to a temporary file on the disk.
Writing to temporary files is controlled by the “Max temporary file size” and “Temporay file limit” directives.
When buffering is disabled, the response is passed to a client synchronously, immediately as it is received.
The reverse proxy will not try to read the whole response from the proxied server.
The maximum size of the data that reverse-proxy can receive from the server at a time is set by the “proxy buffer size” directive.
The Minimal Cached requests sets the number of requests after which the response will be cached ( 1 means first time seen, save to cache)
Cache time (Minutes) sets caching time for all responses.
Proxy buffer: This is the global buffer that sets the number and size of the buffers used for reading a response from the proxied server, for a single connection.
By default, the buffer size is equal to one memory page. This is either 4K or 8K, depending on a platform.
Temporay file limit Limits the size of data written to a temporary file at a time, when buffering of responses from the proxied server to temporary files is enabled.[br]
By default, size is limited by two buffers set by the proxy buffer size and proxy buffers directives.[br]
The maximum size of a temporary file is set by the Max temporary file size directive.
Max temporary file size: When buffering of responses from the proxied server is enabled, and the whole response does not fit into the buffers set by the proxy buffer size and proxy buffers directives, a part of the response can be saved to a temporary file.This directive sets the maximum size of the temporary file.