MCPcopy Index your code
hub / github.com/apache/httpd / ap_cache_check_no_store

Function ap_cache_check_no_store

modules/cache/cache_util.c:493–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493int ap_cache_check_no_store(cache_request_rec *cache, request_rec *r)
494{
495
496 cache_server_conf *conf =
497 (cache_server_conf *)ap_get_module_config(r->server->module_config,
498 &cache_module);
499
500 /*
501 * At this point, we may have data cached, but the request may have
502 * specified that cached data may not be used in a response.
503 *
504 * - RFC2616 14.9.2 What May be Stored by Caches. If Cache-Control:
505 * no-store arrives, do not serve from or store to the cache.
506 */
507
508 /* This value comes from the client's initial request. */
509 if (!cache->control_in.parsed) {
510 const char *cc_req = cache_table_getm(r->pool, r->headers_in,
511 "Cache-Control");
512 const char *pragma = cache_table_getm(r->pool, r->headers_in, "Pragma");
513 ap_cache_control(r, &cache->control_in, cc_req, pragma, r->headers_in);
514 }
515
516 if (cache->control_in.no_store) {
517
518 if (!conf->ignorecachecontrol) {
519 /* We're not allowed to serve a cached copy */
520 return 0;
521 }
522 else {
523 ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02658)
524 "Incoming request is asking for a no-store version of "
525 "%s, but we have been configured to ignore it and serve "
526 "cached content anyway", r->unparsed_uri);
527 }
528 }
529
530 return 1;
531}
532
533int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache,
534 request_rec *r)

Callers 2

cache_quick_handlerFunction · 0.85
cache_handlerFunction · 0.85

Calls 3

ap_get_module_configFunction · 0.85
cache_table_getmFunction · 0.85
ap_cache_controlFunction · 0.85

Tested by

no test coverage detected