nocache_headers()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
nocache_headers()
Описание
Разные браузеры поддерживают разные заголовки nocache, поэтому необходимо отправить несколько заголовков, чтобы все они поняли, что кеширование не должно выполняться.
См. alsowp_get_nocache_headers()
Оригинал (английский)
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.
Исходный код
wp-includes/functions.php:1538
function nocache_headers() {
if ( headers_sent() ) {
return;
}
$headers = wp_get_nocache_headers();
unset( $headers['Last-Modified'] );
header_remove( 'Last-Modified' );
foreach ( $headers as $name => $field_value ) {
header( "{$name}: {$field_value}" );
}
}
История изменений
| Версия | Описание |
|---|---|
| 2.0.0 | Introduced. |

