WordPress函数文档cache_javascript_headers()
将有JavaScript类型的页头缓存10天 描述 译文 设置页头,将有JavaScript类型的页头保存十天…
将有JavaScript类型的页头缓存10天
描述
译文
设置页头,将有JavaScript类型的页头保存十天。
原文
Set the headers for caching for 10 days with JavaScript content type.
用法
<?php cache_javascript_headers() ?>
参数
None.
返回值
(void)
This function does not return a value.
历史
添加于 版本: 2.1.0
源文件
cache_javascript_headers() 函数的代码位于 wp-includes/functions.php.
| 
 1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
 | 
 /* ———————————- 
 * wordpress函数 kim收集 
 * ———————————- */ 
/** 
 * Set the headers for caching for 10 days with JavaScript content type. 
 * 
 * @since 2.1.0 
 */ 
function cache_javascript_headers() {
 
	$expiresOffset = 10 * DAY_IN_SECONDS;
 
	header( “Content-Type: text/javascript; charset=” . get_bloginfo( ‘charset’ ) );
 
	header( “Vary: Accept-Encoding” ); // Handle proxies
 
	header( “Expires: “ . gmdate( “D, d M Y H:i:s”, time() + $expiresOffset ) . ” GMT” );
 
} 
 | 
- 原文:http://codex.wordpress.org/Function_Reference/cache_javascript_headers
 
类别:WordPress函数文档、 
		本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论功能已经关闭!