aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_cache.h
Commit message (Collapse)AuthorAge
* Cache: keep c->body_start when Vary changes (ticket #2029).Sergey Kandaurov2020-09-09
| | | | | | | | If the variant hash doesn't match one we used as a secondary cache key, we switch back to the original key. In this case, c->body_start was kept updated from an existing cache node overwriting the new response value. After file cache update, it led to discrepancy between a cache node and cache file seen as critical errors "file cache .. has too long header".
* Cache: reset c->body_start when reading a variant on Vary mismatch.Sergey Kandaurov2017-08-04
| | | | | | Previously, a variant not present in shared memory and stored on disk using a secondary key was read using c->body_start from a variant stored with a main key. This could result in critical errors "cache file .. has too long header".
* Cache: introduced min_free cache clearing.Maxim Dounin2020-06-22
| | | | | | | | | | | Clearing cache based on free space left on a file system is expected to allow better disk utilization in some cases, notably when disk space might be also used for something other than nginx cache (including nginx own temporary files) and while loading cache (when cache size might be inaccurate for a while, effectively disabling max_size cache clearing). Based on a patch by Adam Bambuch.
* Cache: increased cache header Vary and ETag lengths to 128.Maxim Dounin2017-02-10
| | | | | | | | | | | | This allows to store larger ETag values for proxy_cache_revalidate, including ones generated as SHA256, and cache responses with longer Vary (ticket #826). In particular, this fixes caching of Amazon S3 responses with CORS enabled, which now use "Vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method". Cache version bumped accordingly.
* Upstream: proxy_cache_background_update and friends.Roman Arutyunyan2017-02-10
| | | | The directives enable cache updates in subrequests.
* Cache: support for stale-while-revalidate and stale-if-error.Roman Arutyunyan2016-12-22
| | | | | | | | Previously, there was no way to enable the proxy_cache_use_stale behavior by reading the backend response. Now, stale-while-revalidate and stale-if-error Cache-Control extensions (RFC 5861) are supported. They specify, how long a stale response can be used when a cache entry is being updated, or in case of an error.
* Cache: prefix-based temporary files.Maxim Dounin2016-11-03
| | | | | | | | | | | On Linux, the rename syscall can be slow due to a global file system lock, acquired for the entire rename operation, unless both old and new files are in the same directory. To address this temporary files are now created in the same directory as the expected resulting cache file when using the "use_temp_path=off" parameter. This change mostly reverts 99639bfdfa2a and 3281de8142f5, restoring the behaviour as of a9138c35120d (with minor changes).
* Modules compatibility: compatibility with NGX_THREADS.Maxim Dounin2016-10-10
| | | | | | | With this change it is now possible to load modules compiled without the "--with-threads" configure option into nginx binary compiled with it, and vice versa (if a module does not use thread-specific functions), assuming both use the "--with-compat" option.
* Cache: cache manager limits.Dmitry Volyntsev2016-10-05
| | | | | | | | | The new parameters "manager_files", "manager_sleep" and "manager_threshold" were added to proxy_cache_path and friends. Note that ngx_path_manager_pt was changed to return ngx_msec_t instead of time_t (API change).
* Modules compatibility: cache purge fields.Maxim Dounin2016-09-29
|
* Cache: added watermark to reduce IO load when keys_zone is full.Dmitry Volyntsev2016-03-18
| | | | | | | | When a keys_zone is full then each next request to the cache is penalized. That is, the cache has to evict older files to get a slot from the keys_zone synchronously. The patch introduces new behavior in this scenario. Manager will try to maintain available free slots in the keys_zone by cleaning old files in the background.
* Cache: report error if slab allocator fails during cache loading.Dmitry Volyntsev2016-03-18
|
* Cache: added support for reading of the header in thread pools.Valentin Bartenev2015-04-01
|
* Cache: added temp_path to file cache.Roman Arutyunyan2015-02-02
| | | | | | If use_temp_path is set to off, a subdirectory "temp" is created in the cache directory. It's used instead of proxy_temp_path and friends for caching upstream response.
* Upstream: use_temp_path parameter of proxy_cache_path and friends.Valentin Bartenev2014-12-26
| | | | | When set to "off", temporary files for cacheable responses will be stored inside cache directory.
* Cache: update variant while setting header.Valentin Bartenev2014-12-26
| | | | | | Some parts of code related to handling variants of a resource moved into a separate function that is called earlier. This allows to use cache file name as a prefix for temporary file in the following patch.
* Cache: proxy_cache_lock_age and friends.Roman Arutyunyan2014-11-18
| | | | | | Once this age is reached, the cache lock is discarded and another request can acquire the lock. Requests which failed to acquire the lock are not allowed to cache the response.
* Cache: multiple variants of a resource now can be stored.Maxim Dounin2014-10-27
| | | | | | | | | If a variant stored can't be used to respond to a request, the variant hash is used as a secondary key. Additionally, if we previously switched to a secondary key, while storing a response to cache we check if the variant hash still apply. If not, we switch back to the original key, to handle cases when Vary changes.
* Cache: c->reading flag introduced.Maxim Dounin2014-10-27
| | | | | It replaces c->buf in checks in ngx_http_file_cache_open(), making it possible to reopen the file without clearing c->buf. No functional changes.
* Cache: hash of Vary headers now stored in cache.Maxim Dounin2014-10-27
| | | | | | | | To cache responses with Vary, we now calculate hash of headers listed in Vary, and return the response from cache only if new request headers match. As of now, only one variant of the same resource can be stored in cache.
* Cache: ETag now saved into cache header.Maxim Dounin2014-06-26
|
* Cache: version in cache files.Maxim Dounin2014-06-26
| | | | | This allows to change the structure of cache files without spamming logs with false alerts.
* Upstream: cache revalidation with conditional requests.Maxim Dounin2013-11-18
| | | | | | | | | | | | The following new directives are introduced: proxy_cache_revalidate, fastcgi_cache_revalidate, scgi_cache_revalidate, uwsgi_cache_revalidate. Default is off. When set to on, they enable cache revalidation using conditional requests with If-Modified-Since for expired cache items. As of now, no attempts are made to merge headers given in a 304 response during cache revalidation with headers previously stored in a cache item. Headers in a 304 response are only used to calculate new validity time of a cache item.
* Copyright updated.Maxim Konovalov2012-01-18
|
* Cache locks initial implementation.Maxim Dounin2011-12-26
| | | | | | | | | | | | | | | | | | | | | | New directives: proxy_cache_lock on/off, proxy_cache_lock_timeout. With proxy_cache_lock set to on, only one request will be allowed to go to upstream for a particular cache item. Others will wait for a response to appear in cache (or cache lock released) up to proxy_cache_lock_timeout. Waiting requests will recheck if they have cached response ready (or are allowed to run) every 500ms. Note: we intentionally don't intercept NGX_DECLINED possibly returned by ngx_http_file_cache_read(). This needs more work (possibly safe, but needs further investigation). Anyway, it's exceptional situation. Note: probably there should be a way to disable caching of responses if there is already one request fetching resource to cache (without waiting at all). Two possible ways include another cache lock option ("no_cache") or using proxy_no_cache with some supplied variable. Note: probably there should be a way to lock updating requests as well. For now "proxy_cache_use_stale updating" is available.
* loader_files, loader_sleep, and loader_thresholdIgor Sysoev2011-07-29
|
* Use more precise stat.st_blocks to account cache size on UnixIgor Sysoev2011-04-22
| | | | | instead of file length rounded to a file system block size. There is no similar way on Windows, so rounding to a cache->bsize is kept.
* fix race condition if during reconfiguration two cache managers tryIgor Sysoev2010-09-02
| | | | | | | to delete old inactive entries: one of them removes a entry just locked by other manager from the queue and the rbtree as long inactive entry, causes the latter manager to segfault leaving cache mutex locked, the bug has been introduced in r3727
* several changes in cache cleanup handling:Igor Sysoev2010-07-28
| | | | | | | | | *) now ngx_http_file_cache_cleanup() uses ngx_http_file_cache_free() *) ngx_http_file_cache_free() interface has been changed to accept r->cache ngx_http_file_cache_cleanup() must use r->cache, but not r, because there can be several r->cache's during request processing, r->cache may be NULL at request finalising, etc. *) test if updating request does not complete correctly
* proxy_cache_pass, fastcgi_cache_bypass, uwsgi_cache_bypass, scgi_cache_bypassIgor Sysoev2010-07-19
|
* rename ngx_http_file_cache_create() to ngx_http_file_cache_new()Igor Sysoev2010-07-16
|
* ngx_http_file_cache_create()Igor Sysoev2010-07-15
|
* use ngx_http_test_predicates(), ngx_http_set_predicate_slot()Igor Sysoev2010-07-14
| | | | delete ngx_http_cache(), ngx_http_no_cache_set_slot()
* proxy_no_cache and fastcgi_no_cacheIgor Sysoev2010-05-24
|
* FreeBSD and Linux AIO supportIgor Sysoev2009-08-28
|
* cache loader processIgor Sysoev2009-08-10
|
* $upstream_cache_statusIgor Sysoev2009-06-18
|
* proxy_cache_use_stale/fastcgi_cache_use_stale updatingIgor Sysoev2009-06-06
|
* delete useless r->cache->usesIgor Sysoev2009-06-06
|
* remove remnantsIgor Sysoev2009-06-06
|
* support attaching to an existent Win32 shared memoryIgor Sysoev2009-04-18
|
* introduce cache manager instead of cache cleanerIgor Sysoev2009-03-30
|
* a prelimiary proxy cache supportIgor Sysoev2009-03-23
|
* nginx-0.1.13-RELEASE importrelease-0.1.13Igor Sysoev2004-12-21
| | | | | | | | | | | *) Feature: the server_names_hash and server_names_hash_threshold directives. *) Bugfix: the *.domain.tld names in the "server_name" directive did not work. *) Bugfix: the %request_length log parameter logged the incorrect length.
* nginx-0.1.11-RELEASE importrelease-0.1.11Igor Sysoev2004-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *) Feature: the worker_priority directive. *) Change: both tcp_nopush and tcp_nodelay directives affect the transferred response. *) Bugfix: nginx did not call initgroups(). Thanks to Andrew Sitnikov and Andrei Nigmatulin. *) Change: now the ngx_http_autoindex_module shows the file size in the bytes. *) Bugfix: the ngx_http_autoindex_module returned the 500 error if the broken symlink was in a directory. *) Bugfix: the files bigger than 4G could not be transferred using sendfile. *) Bugfix: if the backend was resolved to several backends and there was an error while the response waiting then process may got caught in an endless loop. *) Bugfix: the worker process may exit with the "unknown cycle" message when the /dev/poll method was used. *) Bugfix: "close() channel failed" errors. *) Bugfix: the autodetection of the "nobody" and "nogroup" groups. *) Bugfix: the send_lowat directive did not work on Linux. *) Bugfix: the segmentation fault occurred if there was no events section in configuration. *) Bugfix: nginx could not be built on OpenBSD. *) Bugfix: the double slashes in "://" in the URI were converted to ":/".
* nginx-0.1.9-RELEASE importrelease-0.1.9Igor Sysoev2004-11-25
| | | | | | | | | | | | | | | *) Bugfix: the proxied request was sent without arguments if the request contains "//", "/./", "/../" or "%XX". *) Bugfix: the large compressed responses may be transferred not completely. *) Bugfix: the files bigger than 2G was not transferred on Linux that does not support sendfile64(). *) Bugfix: while the build configuration on Linux the --with-poll_module parameter was required; the bug had appeared in 0.1.8.
* nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyrightIgor Sysoev2004-09-29
|
* nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused filesIgor Sysoev2004-09-28
|
* nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_tIgor Sysoev2004-05-28
|
* nginx-0.0.2-2004-02-23-23:57:12 importIgor Sysoev2004-02-23
|