I have a question. If the file being written to a cache exceeds max size what
behavior happens? As I can think of it there are 3 possible outcomes.
File is written and later cleaned up by the cache manager (bad)
File isnt written. It is recognized that it can’t be cached.
The file is written and truncated (bad)
Thanks
The file is written, and later cleaned up by the cache manager.
It might even be used for a while to serve requests, as it takes
some time (up to 10 seconds) for the cache manager to recognize
the max_size limit was exceeded and least recently used files
should be removed from the cache.
Is it possible to get the upstream response size in lua and set a variable to
influence proxy_no_cache? If it is ill learn lua.
By the time Lua gets involved, the response has already been cached (or
not).
You could do your own cache instead of proxy_cache, of course. I have
some things that store the “cache” in redis, for example. Could be
memcache, custom cache, etc.
I came up with a crude solution, proxy_max_temp_file_size. By limiting
the
max size in cached paths to 50mb I should make it impossible for someone
to
store GBs of data to the disk before the cache manager runs.
On Mon, Jul 02, 2012 at 02:56:47AM +1000, SplitIce wrote:
I came up with a crude solution, proxy_max_temp_file_size. By limiting the
max size in cached paths to 50mb I should make it impossible for someone to
store GBs of data to the disk before the cache manager runs.
No, the proxy_max_temp_file_size directive is ignored if cache is
used. This is for reason, as common use case is to disable disk
buffering with “proxy_max_temp_file_size 0;”, but have cache
switched on for some requests.
Maxim D.
Is it possible to get the upstream response size in lua and set a