wp_get_nocache_headers
函数
wp_get_nocache_headers ( No parameters )
- 返回值
-
- (array) The associative array of header names and field values.
- 定义位置
-
-
wp-includes/functions.php
, line 1485
-
wp-includes/functions.php
- 引入
- 2.8.0
- 弃用
- –
获取防止缓存的标头信息。
几个不同的标头信息涵盖了不同浏览器处理缓存的不同方式。
function wp_get_nocache_headers() {
$headers = array(
'Expires' => 'Wed, 11 Jan 1984 05:00:00 GMT',
'Cache-Control' => 'no-cache, must-revalidate, max-age=0',
);
if ( function_exists( 'apply_filters' ) ) {
/**
* Filters the cache-controlling headers.
*
* @since 2.8.0
*
* @see wp_get_nocache_headers()
*
* @param array $headers Header names and field values.
*/
$headers = (array) apply_filters( 'nocache_headers', $headers );
}
$headers['Last-Modified'] = false;
return $headers;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。


