Changeset 55968
- Timestamp:
- 06/21/2023 06:25:40 PM (18 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r55872 r55968 1478 1478 1479 1479 /** 1480 * Gets the header information to prevent caching.1480 * Gets the HTTP header information to prevent caching. 1481 1481 * 1482 1482 * The several different headers cover the different ways cache prevention 1483 * is handled by different browsers 1483 * is handled by different browsers. 1484 1484 * 1485 1485 * @since 2.8.0 1486 * @since 6.3.0 The `Cache-Control` header for logged in users now includes the 1487 * `no-store` and `private` directives. 1486 1488 * 1487 1489 * @return array The associative array of header names and field values. 1488 1490 */ 1489 1491 function wp_get_nocache_headers() { 1492 $cache_control = ( function_exists( 'is_user_logged_in' ) && is_user_logged_in() ) 1493 ? 'no-cache, must-revalidate, max-age=0, no-store, private' 1494 : 'no-cache, must-revalidate, max-age=0'; 1495 1490 1496 $headers = array( 1491 1497 'Expires' => 'Wed, 11 Jan 1984 05:00:00 GMT', 1492 'Cache-Control' => 'no-cache, must-revalidate, max-age=0',1498 'Cache-Control' => $cache_control, 1493 1499 ); 1494 1500 1495 1501 if ( function_exists( 'apply_filters' ) ) { 1496 1502 /** 1497 * Filters the cache-controlling headers.1503 * Filters the cache-controlling HTTP headers that are used to prevent caching. 1498 1504 * 1499 1505 * @since 2.8.0 … … 1510 1516 1511 1517 /** 1512 * Sets the headers to prevent caching for the different browsers.1518 * Sets the HTTP headers to prevent caching for the different browsers. 1513 1519 * 1514 1520 * Different browsers support different nocache headers, so several … … 1537 1543 1538 1544 /** 1539 * Sets the headers for caching for 10 days with JavaScript content type.1545 * Sets the HTTP headers for caching for 10 days with JavaScript content type. 1540 1546 * 1541 1547 * @since 2.1.0
Note: See TracChangeset
for help on using the changeset viewer.