WordPress开发函数cache_javascript_headers()
wordpress开发函数cache_javascript_headers(),使用JavaScript内容类型设置10天的缓存头。
cache_javascript_headers()
文件: 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' ); }
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。
本文地址:https://chcsas.com/ywkf/581.html