# wp_get_nocache_headers()

URL: https://chugunov.pro/api-wordpress/functions/wp_get_nocache_headers/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 2.8.0.

## Сигнатура

```php
wp_get_nocache_headers(): array
```

## Описание

Несколько разных заголовков охватывают различные способы, которыми предотвращение кеширования обрабатывается разными браузерами или промежуточными кешами, такими как прокси-серверы.

## Возвращаемое значение

`array`

## Исходный код

Файл: `wp-includes/functions.php:1503`

```php
function wp_get_nocache_headers() {
	$cache_control = 'no-cache, must-revalidate, max-age=0, no-store, private';

	$headers = array(
		'Expires'       => 'Wed, 11 Jan 1984 05:00:00 GMT',
		'Cache-Control' => $cache_control,
	);

	if ( function_exists( 'apply_filters' ) ) {
		/**
		 * Filters the cache-controlling HTTP headers that are used to prevent caching.
		 *
		 * @since 2.8.0
		 *
		 * @see wp_get_nocache_headers()
		 *
		 * @param array $headers Header names and field values.
		 */
		$headers = (array) apply_filters( 'nocache_headers', $headers );
	}
	$headers['Last-Modified'] = false;
	return $headers;
}
```

## История изменений

- 6.8.0 — The Cache-Control header now includes the no-store and private directives regardless of whether a user is logged in.
- 6.3.0 — The Cache-Control header for logged in users now includes the no-store and private directives.
- 2.8.0 — Introduced.

## Связанные

Использует: [`apply_filters`](https://chugunov.pro/api-wordpress/functions/apply_filters/).
Используется в: `WP_REST_Server::serve_request`, `WP::send_headers`, [`nocache_headers`](https://chugunov.pro/api-wordpress/functions/nocache_headers/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_get_nocache_headers/
