函数原型
cache_javascript_headers()
函数描述
Sets the headers for caching for 10 days with JavaScript content type.
是否弃用
未弃用
函数参数
无
函数返回值
无
函数位置
File: wp-includes/functions.php.
函数源码
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' );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |

