I'm new to Nginx. My nginx cache setting in the nginx.conf
fastcgi_cache_path /dev/shm levels=1:2 keys_zone=my-cache:100m inactive=7d;
What is it means? the level, 100m and inactive=7d ?
Thank's in advaced.
From the Nginx conf page: http://wiki.nginx.org/HttpFastcgiModule#fastcgi_cache_path
"Level parameter sets number and width of the names of subdirectories used to store caching files."
In other words, if you set your cache to
Regarding keys_zone and inactive:
"In addition, all active keys and information about data are stored in a shared memory zone, whose name and size are configured by the keys_zone parameter. Cached data that are not accessed during the time specified by the inactive parameter get removed from the cache regardless of their freshness. By default, inactive is set to 10 minutes."
The keys_zone parameter essentially acts as an "address book" to all the files in the cache. The name parameter simply names the keys_zone area for this nginx instance and the size parameter increases/decreases the total size available to be filled up with keys. In other words, the larger your cache(read: inactive set high) and the higher your traffic, the larger you want your keys_zone to be if you want to be able to cache everything.