Lines Matching defs:cache
22 APLOG_USE_MODULE(cache);
31 * delete all URL entities from the cache
34 int cache_remove_url(cache_request_rec *cache, request_rec *r)
39 list = cache->providers;
41 /* Remove the stale cache entry if present. If not, we're
45 h = cache->stale_handle ? cache->stale_handle : cache->handle;
50 "cache: Removing url %s from the cache", h->cache_obj->key);
52 /* for each specified cache type, delete the URL */
62 * create a new URL entity in the cache
68 * The size of the entity is provided so that a cache module can
69 * decide whether or not it wants to cache this particular entity.
72 int cache_create_entity(cache_request_rec *cache, request_rec *r,
79 if (!cache) {
82 "cache: No cache request information available for key"
87 if (!cache->key) {
88 rv = cache_generate_key(r, r->pool, &cache->key);
94 list = cache->providers;
95 /* for each specified cache type, delete the URL */
97 switch (rv = list->provider->create_entity(h, r, cache->key, size, in)) {
99 cache->handle = h;
100 cache->provider = list->provider;
101 cache->provider_name = list->provider_name;
121 * 14.46) MUST be deleted from the cache entry and the forwarded
134 * in the cache entry and the forwarded response.
182 * from the cache.
192 /* If the cache gave us a Last-Modified header, we can't just
204 * select a specific URL entity in the cache
214 int cache_select(cache_request_rec *cache, request_rec *r)
220 if (!cache) {
223 "cache: No cache request information available for key"
228 /* if no-cache, we can't serve from the cache, but we may store to the
229 * cache.
231 if (!ap_cache_check_no_cache(cache, r)) {
235 if (!cache->key) {
236 rv = cache_generate_key(r, r->pool, &cache->key);
242 /* go through the cache types till we get a match */
245 list = cache->providers;
248 switch ((rv = list->provider->open_entity(h, r, cache->key))) {
255 /* try again with next cache type */
264 * the cache is the same object that would be delivered to the
273 * cache the req_hdrs if the response contains a Vary
309 /* try again with next cache type */
314 cache->provider = list->provider;
315 cache->provider_name = list->provider_name;
321 * cache validators, MUST NOT return a locally cached response to the
337 if (mismatch || !cache_check_freshness(h, cache, r)) {
343 if (cache->control_in.only_if_cached) {
344 /* try again with next cache type */
350 cache->stale_headers = apr_table_copy(r->pool,
352 cache->stale_handle = h;
403 cache->handle = h;
407 /* try again with next cache type */
419 if (cache->control_in.only_if_cached) {
421 "cache: 'only-if-cached' requested and no cached entity, "
454 * Use the canonical name to improve cache hit rate, but only if this is
465 * If a cache entry is created by the CACHE_SAVE filter we always have
656 * Store the key in the request_config for the cache as r->parsed_uri
660 * resource in the cache under a key where it is never found by the quick
664 APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, APLOGNO(00698) "cache: Key for entity %s?%s is %s", uri, parsed_uri->query, *key);
684 int cache_invalidate(cache_request_rec *cache, request_rec *r)
695 if (!cache) {
698 APLOG_MARK, APLOG_ERR, APR_EGENERAL, r, APLOGNO(00697) "cache: No cache request information available for key"
703 if (!cache->key) {
704 rv = cache_generate_key(r, r->pool, &cache->key);
738 /* go through the cache types */
741 list = cache->providers;
746 rv = list->provider->open_entity(h, r, cache->key);
752 APLOG_MARK, APLOG_DEBUG, rv, r, APLOGNO(02468) "cache: Attempted to invalidate cached entity with key: %s", cache->key);
762 APLOG_MARK, APLOG_DEBUG, rv, r, APLOGNO(02469) "cache: Attempted to invalidate cached entity with key: %s", location_key);
773 APLOG_MARK, APLOG_DEBUG, rv, r, APLOGNO(02470) "cache: Attempted to invalidate cached entity with key: %s", content_location_key);