Changeset 10619 for trunk/wp-includes/functions.php
- Timestamp:
- 02/21/2009 09:39:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r10617 r10619 1461 1461 1462 1462 /** 1463 * Gets the header information to prevent caching. 1464 * 1465 * The several different headers cover the different ways cache prevention is handled 1466 * by different browsers 1467 * 1468 * @since 2.8 1469 * 1470 * @uses apply_filters() 1471 * @return array The associative array of header names and field values. 1472 */ 1473 function wp_get_nocache_headers() { 1474 $headers = array( 1475 'Expires' => 'Wed, 11 Jan 1984 05:00:00 GMT', 1476 'Last-Modified' => gmdate( 'D, d M Y H:i:s' ) . ' GMT', 1477 'Cache-Control' => 'no-cache, must-revalidate, max-age=0', 1478 'Pragma' => 'no-cache', 1479 ); 1480 return apply_filters('nocache_headers', $headers); 1481 } 1482 1483 /** 1463 1484 * Sets the headers to prevent caching for the different browsers. 1464 1485 * … … 1467 1488 * 1468 1489 * @since 2.0.0 1490 * @uses wp_get_nocache_headers() 1469 1491 */ 1470 1492 function nocache_headers() { 1471 // why are these @-silenced when other header calls aren't? 1472 @header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' ); 1473 @header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); 1474 @header( 'Cache-Control: no-cache, must-revalidate, max-age=0' ); 1475 @header( 'Pragma: no-cache' ); 1493 $headers = wp_get_nocache_headers(); 1494 foreach( (array) $headers as $name => $field_value ) 1495 @header("{$name}: {$field_value}"); 1476 1496 } 1477 1497
Note: See TracChangeset
for help on using the changeset viewer.