Changeset 7575 for trunk/bp-activity/bp-activity-classes.php
- Timestamp:
- 11/15/2013 08:57:18 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r7477 r7575 1297 1297 $modified_timestamp = strtotime( $last_modified ); 1298 1298 $etag = md5( $last_modified ); 1299 1299 1300 1300 // Set cache-related headers 1301 1301 @header( 'Last-Modified: ' . $last_modified ); 1302 1302 @header( 'Pragma: no-cache' ); 1303 1303 @header( 'ETag: ' . '"' . $etag . '"' ); 1304 1304 1305 1305 // First commit of BuddyPress! (Easter egg) 1306 1306 @header( 'Expires: Tue, 25 Mar 2008 17:13:55 GMT'); 1307 1307 1308 1308 // Get ETag from supported user agents 1309 1309 if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ) { 1310 1310 $client_etag = wp_unslash( $_SERVER['HTTP_IF_NONE_MATCH'] ); 1311 1311 1312 1312 // Remove quotes from ETag 1313 1313 $client_etag = trim( $client_etag, '"' ); 1314 1314 1315 1315 // Strip suffixes from ETag if they exist (eg. "-gzip") 1316 1316 if ( $etag_suffix_pos = strpos( $client_etag, '-' ) ) { … … 1322 1322 $client_etag = false; 1323 1323 } 1324 1324 1325 1325 // Get client last modified timestamp from supported user agents 1326 1326 $client_last_modified = empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? '' : trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ); 1327 1327 $client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0; 1328 1328 1329 1329 // Set 304 status if feed hasn't been updated since last fetch 1330 1330 if ( ( $client_last_modified && $client_etag ) ? … … 1335 1335 $status = false; 1336 1336 } 1337 1337 1338 1338 // If feed hasn't changed as reported by the user agent, set 304 status header 1339 1339 if ( ! empty( $status ) ) { 1340 1340 status_header( $status ); 1341 1341 1342 1342 // cached response, so stop now! 1343 1343 if ( $status == 304 ) {
Note: See TracChangeset
for help on using the changeset viewer.