|
Apache HTTPD
|
Classes | |
| struct | cache_enable |
| struct | cache_disable |
| struct | cache_server_conf |
| struct | cache_dir_conf |
| struct | cache_provider_list |
| struct | cache_request_rec |
Macros | |
| #define | APR_WANT_STRFUNC |
| #define | MAX(a, b) ((a) > (b) ? (a) : (b)) |
| #define | MIN(a, b) ((a) < (b) ? (a) : (b)) |
| #define | MSEC_ONE_DAY ((apr_time_t)(86400*APR_USEC_PER_SEC)) /* one day, in microseconds */ |
| #define | MSEC_ONE_HR ((apr_time_t)(3600*APR_USEC_PER_SEC)) /* one hour, in microseconds */ |
| #define | MSEC_ONE_MIN ((apr_time_t)(60*APR_USEC_PER_SEC)) /* one minute, in microseconds */ |
| #define | MSEC_ONE_SEC ((apr_time_t)(APR_USEC_PER_SEC)) /* one second, in microseconds */ |
| #define | DEFAULT_CACHE_MAXEXPIRE MSEC_ONE_DAY |
| #define | DEFAULT_CACHE_MINEXPIRE 0 |
| #define | DEFAULT_CACHE_EXPIRE MSEC_ONE_HR |
| #define | DEFAULT_CACHE_LMFACTOR (0.1) |
| #define | DEFAULT_CACHE_MAXAGE 5 |
| #define | DEFAULT_X_CACHE 0 |
| #define | DEFAULT_X_CACHE_DETAIL 0 |
| #define | DEFAULT_CACHE_STALE_ON_ERROR 1 |
| #define | DEFAULT_CACHE_LOCKPATH "/mod_cache-lock" |
| #define | CACHE_LOCKNAME_KEY "mod_cache-lockname" |
| #define | CACHE_LOCKFILE_KEY "mod_cache-lockfile" |
| #define | CACHE_CTX_KEY "mod_cache-ctx" |
| #define | CACHE_SEPARATOR ", \t" |
Typedefs | |
| typedef struct cache_provider_list | cache_provider_list |
Functions | |
| int | ap_cache_check_no_cache (cache_request_rec *cache, request_rec *r) |
| int | ap_cache_check_no_store (cache_request_rec *cache, request_rec *r) |
| int | cache_check_freshness (cache_handle_t *h, cache_request_rec *cache, request_rec *r) |
| apr_status_t | cache_try_lock (cache_server_conf *conf, cache_request_rec *cache, request_rec *r) |
| apr_status_t | cache_remove_lock (cache_server_conf *conf, cache_request_rec *cache, request_rec *r, apr_bucket_brigade *bb) |
| cache_provider_list * | cache_get_providers (request_rec *r, cache_server_conf *conf) |
| const char * | cache_table_getm (apr_pool_t *p, const apr_table_t *t, const char *key) |
| char * | cache_strqtok (char *str, const char *sep, char **last) |
| apr_table_t * | cache_merge_headers_out (request_rec *r) |
| int | cache_use_early_url (request_rec *r) |
| #define APR_WANT_STRFUNC |
Definition at line 44 of file cache_util.h.
Definition at line 101 of file cache_util.h.
Definition at line 100 of file cache_util.h.
Definition at line 99 of file cache_util.h.
| #define CACHE_SEPARATOR ", \t" |
Definition at line 102 of file cache_util.h.
| #define DEFAULT_CACHE_EXPIRE MSEC_ONE_HR |
Definition at line 92 of file cache_util.h.
| #define DEFAULT_CACHE_LMFACTOR (0.1) |
Definition at line 93 of file cache_util.h.
Definition at line 98 of file cache_util.h.
| #define DEFAULT_CACHE_MAXAGE 5 |
Definition at line 94 of file cache_util.h.
| #define DEFAULT_CACHE_MAXEXPIRE MSEC_ONE_DAY |
Definition at line 90 of file cache_util.h.
| #define DEFAULT_CACHE_MINEXPIRE 0 |
Definition at line 91 of file cache_util.h.
| #define DEFAULT_CACHE_STALE_ON_ERROR 1 |
Definition at line 97 of file cache_util.h.
| #define DEFAULT_X_CACHE 0 |
Definition at line 95 of file cache_util.h.
| #define DEFAULT_X_CACHE_DETAIL 0 |
Definition at line 96 of file cache_util.h.
| #define MSEC_ONE_DAY ((apr_time_t)(86400*APR_USEC_PER_SEC)) /* one day, in microseconds */ |
Definition at line 85 of file cache_util.h.
| #define MSEC_ONE_HR ((apr_time_t)(3600*APR_USEC_PER_SEC)) /* one hour, in microseconds */ |
Definition at line 86 of file cache_util.h.
| #define MSEC_ONE_MIN ((apr_time_t)(60*APR_USEC_PER_SEC)) /* one minute, in microseconds */ |
Definition at line 87 of file cache_util.h.
| #define MSEC_ONE_SEC ((apr_time_t)(APR_USEC_PER_SEC)) /* one second, in microseconds */ |
Definition at line 88 of file cache_util.h.
Definition at line 201 of file cache_util.h.
| int ap_cache_check_no_cache | ( | cache_request_rec * | cache, |
| request_rec * | r | ||
| ) |
Check the whether the request allows a cached object to be served as per RFC2616 section 14.9.4 (Cache Revalidation and Reload Controls)
| cache | cache_request_rec |
| r | request_rec |
Definition at line 450 of file cache_util.c.
| int ap_cache_check_no_store | ( | cache_request_rec * | cache, |
| request_rec * | r | ||
| ) |
Check the whether the request allows a cached object to be stored as per RFC2616 section 14.9.2 (What May be Stored by Caches)
| cache | cache_request_rec |
| r | request_rec |
Definition at line 493 of file cache_util.c.
| int cache_check_freshness | ( | cache_handle_t * | h, |
| cache_request_rec * | cache, | ||
| request_rec * | r | ||
| ) |
Check the freshness of the cache object per RFC2616 section 13.2 (Expiration Model)
| h | cache_handle_t |
| cache | cache_request_rec |
| r | request_rec |
Definition at line 533 of file cache_util.c.
| cache_provider_list * cache_get_providers | ( | request_rec * | r, |
| cache_server_conf * | conf | ||
| ) |
Definition at line 184 of file cache_util.c.
| apr_table_t * cache_merge_headers_out | ( | request_rec * | r | ) |
Merge err_headers_out into headers_out and add request's Content-Type and Content-Encoding if available.
Definition at line 1267 of file cache_util.c.
| apr_status_t cache_remove_lock | ( | cache_server_conf * | conf, |
| cache_request_rec * | cache, | ||
| request_rec * | r, | ||
| apr_bucket_brigade * | bb | ||
| ) |
Remove the cache lock, if present.
First, try to close the file handle, whose delete-on-close should kill the file. Otherwise, just delete the file by name.
If no lock name has yet been calculated, do the calculation of the lock name first before trying to delete the file.
If an optional bucket brigade is passed, the lock will only be removed if the bucket brigade contains an EOS bucket.
Definition at line 390 of file cache_util.c.
String tokenizer that ignores separator characters within quoted strings and escaped characters, as per RFC2616 section 2.2.
Definition at line 929 of file cache_util.c.
| const char * cache_table_getm | ( | apr_pool_t * | p, |
| const apr_table_t * | t, | ||
| const char * | key | ||
| ) |
Get a value from a table, where the table may contain multiple values for a given key.
When the table contains a single value, that value is returned unchanged.
When the table contains two or more values for a key, all values for the key are returned, separated by commas.
Definition at line 1324 of file cache_util.c.
| apr_status_t cache_try_lock | ( | cache_server_conf * | conf, |
| cache_request_rec * | cache, | ||
| request_rec * | r | ||
| ) |
Try obtain a cache wide lock on the given cache key.
If we return APR_SUCCESS, we obtained the lock, and we are clear to proceed to the backend. If we return APR_EEXISTS, then the lock is already locked, someone else has gone to refresh the backend data already, so we must return stale data with a warning in the mean time. If we return anything else, then something has gone pear shaped, and we allow the request through to the backend regardless.
This lock is created from the request pool, meaning that should something go wrong and the lock isn't deleted on return of the request headers from the backend for whatever reason, at worst the lock will be cleaned up when the request is dies or finishes.
If something goes truly bananas and the lock isn't deleted when the request dies, the lock will be trashed when its max-age is reached, or when a request arrives containing a Cache-Control: no-cache. At no point is it possible for this lock to permanently deny access to the backend.
Try obtain a cache wide lock on the given cache key.
If we return APR_SUCCESS, we obtained the lock, and we are clear to proceed to the backend. If we return APR_EEXIST, then the lock is already locked, someone else has gone to refresh the backend data already, so we must return stale data with a warning in the mean time. If we return anything else, then something has gone pear shaped, and we allow the request through to the backend regardless.
This lock is created from the request pool, meaning that should something go wrong and the lock isn't deleted on return of the request headers from the backend for whatever reason, at worst the lock will be cleaned up when the request dies or finishes.
If something goes truly bananas and the lock isn't deleted when the request dies, the lock will be trashed when its max-age is reached, or when a request arrives containing a Cache-Control: no-cache. At no point is it possible for this lock to permanently deny access to the backend.
< Read by user
<
< Write by user
<
< Execute by user
<
< Modification Time
< Number of links
< Open the file for writing
<
< Create the file if not there
<
< Open should fail if APR_FOPEN_CREATE and file exists.
<
< Delete the file after close
<
< Read by user
<
< Write by user
<
Definition at line 279 of file cache_util.c.
| int cache_use_early_url | ( | request_rec * | r | ) |
Return whether to use request's path/query from early stage (r->parsed_uri) or the current/rewritable ones (r->uri/r->args).
< Standard proxy
Definition at line 130 of file cache_util.c.