cache_javascript_headers()

将有JavaScript类型的页头缓存10天

描述

设置页头,将有JavaScript类型的页头保存十天。

用法

<?php cache_javascript_headers() ?>

参数

None.

返回值

(void) 

此函数不返回值。

历史

添加于 版本: 2.1.0

源文件

cache_javascript_headers() 函数的代码位于 wp-includes/functions.php.

/* ———————————-
* wordpress函数 xingkongweb.com收集
* ———————————- */
/**
* 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” );

}
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索