nocache_headers()

 

File: wp-includes/functions.php

function nocache_headers() {
	$headers = wp_get_nocache_headers();

	unset( $headers['Last-Modified'] );

	// In PHP 5.3+, make sure we are not sending a Last-Modified header.
	if ( function_exists( 'header_remove' ) ) {
		@header_remove( 'Last-Modified' );
	} else {
		// In PHP 5.2, send an empty Last-Modified header, but only as a
		// last resort to override a header already sent. #WP23021
		foreach ( headers_list() as $header ) {
			if ( 0 === stripos( $header, 'Last-Modified' ) ) {
				$headers['Last-Modified'] = '';
				break;
			}
		}
	}

	foreach ( $headers as $name => $field_value ) {
		@header( "{$name}: {$field_value}" );
	}
}

参数:nocache_headers()

不同的浏览器支持不同的nocache头文件,因此必须发送多个头文件,以便所有的头文件都达到不进行缓存的目的。

  • WPGGETYnocache_headers()

{acontent5}{acontent3}

You must log in before being able to contribute a note or feedback.

100.00% (1) 次Google访问
  • 蜘蛛:Google,1次,更新时间:2019-05-12 21:52:00

参与评论