Skip to:
Content

BuddyPress.org

Changeset 7575


Ignore:
Timestamp:
11/15/2013 08:57:18 PM (13 years ago)
Author:
boonebgorges
Message:

Pinking shears

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-classes.php

    r7477 r7575  
    12971297                $modified_timestamp = strtotime( $last_modified );
    12981298                $etag               = md5( $last_modified );
    1299        
     1299
    13001300                // Set cache-related headers
    13011301                @header( 'Last-Modified: ' . $last_modified );
    13021302                @header( 'Pragma: no-cache' );
    13031303                @header( 'ETag: ' . '"' . $etag . '"' );
    1304        
     1304
    13051305                // First commit of BuddyPress! (Easter egg)
    13061306                @header( 'Expires: Tue, 25 Mar 2008 17:13:55 GMT');
    1307        
     1307
    13081308                // Get ETag from supported user agents
    13091309                if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ) {
    13101310                        $client_etag = wp_unslash( $_SERVER['HTTP_IF_NONE_MATCH'] );
    1311        
     1311
    13121312                        // Remove quotes from ETag
    13131313                        $client_etag = trim( $client_etag, '"' );
    1314        
     1314
    13151315                        // Strip suffixes from ETag if they exist (eg. "-gzip")
    13161316                        if ( $etag_suffix_pos = strpos( $client_etag, '-' ) ) {
     
    13221322                        $client_etag = false;
    13231323                }
    1324        
     1324
    13251325                // Get client last modified timestamp from supported user agents
    13261326                $client_last_modified      = empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ? '' : trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
    13271327                $client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0;
    1328        
     1328
    13291329                // Set 304 status if feed hasn't been updated since last fetch
    13301330                if ( ( $client_last_modified && $client_etag ) ?
     
    13351335                        $status = false;
    13361336                }
    1337        
     1337
    13381338                // If feed hasn't changed as reported by the user agent, set 304 status header
    13391339                if ( ! empty( $status ) ) {
    13401340                        status_header( $status );
    1341        
     1341
    13421342                        // cached response, so stop now!
    13431343                        if ( $status == 304 ) {
Note: See TracChangeset for help on using the changeset viewer.