[wp-trac] [WordPress Trac] #28722: Boost performance with ETag in load-scripts.php and load-styles.php
WordPress Trac
noreply at wordpress.org
Mon Dec 28 14:23:10 UTC 2015
#28722: Boost performance with ETag in load-scripts.php and load-styles.php
-----------------------------+------------------------------------------
Reporter: sergej.mueller | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 4.5
Component: Script Loader | Version: 4.0
Severity: normal | Resolution:
Keywords: has-patch | Focuses: administration, performance
-----------------------------+------------------------------------------
Comment (by swissspidy):
Replying to [comment:11 ocean90]:
> Replying to [comment:10 swissspidy]:
> > [attachment:28722.4.diff] now uses `status_header( 304 )`.
>
> That will produce a fatal error because the function isn't available
there.
Oops, you're right. My bad.
Well then something along these lines should do the trick:
{{{#!php
$protocol = $_SERVER['SERVER_PROTOCOL'];
if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) )
{
$protocol = 'HTTP/1.0';
}
header( "$protocol 304 Not Modified" );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28722#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list