nocache_headers() - WordPress 函数参考中文文档

返回介绍

nocache_headers()

发布于 2017-09-11 字数1752 浏览 805 评论 0

nocache_headers()

Set the headers to prevent caching for the different browsers.


描述

Different browsers support different nocache headers, so several headers must be sent so that all of them get the point that no caching should occur.


源代码

File: wp-includes/functions.php

function nocache_headers() {
	$headers = wp_get_nocache_headers();

	unset( $headers['Last-Modified'] );

	// In PHP 5.3+, make sure we are not sending a Last-Modified header.
	if ( function_exists( 'header_remove' ) ) {
		@header_remove( 'Last-Modified' );
	} else {
		// In PHP 5.2, send an empty Last-Modified header, but only as a
		// last resort to override a header already sent.

更新日志

Version 描述
2.0.0 Introduced.

相关函数

Uses

  • wp-includes/functions.php:
    wp_get_nocache_headers()

Used By

  • wp-includes/class-wp-customize-manager.php:
    WP_Customize_Manager::customize_preview_init()
  • wp-includes/pluggable.php:
    auth_redirect()
  • wp-includes/class-wp.php:
    WP::handle_404()
  • wp-includes/load.php:
    wp_not_installed()
  • wp-includes/functions.php:
    dead_db()
  • wp-includes/functions.php:
    _default_wp_die_handler()
  • Show 1 more used by
    Hide more used by


User Contributed Notes

上一篇:next_widget_id_number()

下一篇:noindex()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!