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

Function ap_cache_check_no_cache

modules/cache/cache_util.c:450–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450int ap_cache_check_no_cache(cache_request_rec *cache, request_rec *r)
451{
452
453 cache_server_conf *conf =
454 (cache_server_conf *)ap_get_module_config(r->server->module_config,
455 &cache_module);
456
457 /*
458 * At this point, we may have data cached, but the request may have
459 * specified that cached data may not be used in a response.
460 *
461 * This is covered under RFC2616 section 14.9.4 (Cache Revalidation and
462 * Reload Controls).
463 *
464 * - RFC2616 14.9.4 End to end reload, Cache-Control: no-cache, or Pragma:
465 * no-cache. The server MUST NOT use a cached copy when responding to such
466 * a request.
467 */
468
469 /* This value comes from the client's initial request. */
470 if (!cache->control_in.parsed) {
471 const char *cc_req = cache_table_getm(r->pool, r->headers_in,
472 "Cache-Control");
473 const char *pragma = cache_table_getm(r->pool, r->headers_in, "Pragma");
474 ap_cache_control(r, &cache->control_in, cc_req, pragma, r->headers_in);
475 }
476
477 if (cache->control_in.no_cache) {
478
479 if (!conf->ignorecachecontrol) {
480 return 0;
481 }
482 else {
483 ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(02657)
484 "Incoming request is asking for an uncached version of "
485 "%s, but we have been configured to ignore it and serve "
486 "cached content anyway", r->unparsed_uri);
487 }
488 }
489
490 return 1;
491}
492
493int ap_cache_check_no_store(cache_request_rec *cache, request_rec *r)
494{

Callers 1

cache_selectFunction · 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