G
G
gremlintv22018-12-30 00:22:12
Nginx
gremlintv2, 2018-12-30 00:22:12

Does nginx overwrite the older cache when the cache value overflows, or does it allow clients to directly bypass the cache?

Happy Holidays everyone!
Please explain this:
Let's say the following values ​​are set in nginx:

proxy_cache_path /var/cache/nginx/storage_cache_temp levels=1:2 keys_zone=storage:10m max_size=10g inactive=1h;
proxy_cache_valid 200 302 1h;

How nginx will behave with requests for content that is not yet in the cache when the 10g cache is full. if all existing cache has not expired in 1h:
1) It will delete the oldest cache, and overwrite with new one
2) It will not cache new content, just proxying all requests
And if the second option is the case (won't cache new content) how to bring in life the first option (delete the oldest cache, and overwrite with a new one) without changing the lifetime of the cache.
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2018-12-30
@BorisKorobkov

RTFM nginx.org/en/docs/http/ngx_http_proxy_module.html#...

When this size is exceeded, it removes the least recently used data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question