add_action('send_headers', function() { // Xóa hết mọi header cache-control cũ if (headers_sent() === false) { // Bỏ tất cả header cache-control foreach (headers_list() as $header) { if (stripos($header, 'Cache-Control') !== false) { header_remove('Cache-Control'); } } // Gắn header mình mong muốn header('Cache-Control: public, max-age=300, must-revalidate', true); } }, 1000);