我想知道是否有辦法防止在 REST API 中的 wordpress 中快取。我有這個最小的例子:
add_action('rest_api_init', 'get_wp_page_fn2' );
function get_wp_page_fn2(){
register_rest_route( '/wp/v2/tf_api/' ,'get_wp_page2',
array(
'methods' =>'GET',
'callback' => 'get_wp_page_callback2',
)
);
}
function get_wp_page_callback2( $request) {
$response = [
"response" => 1,
"url" => 33,
];
echo json_encode($response);
die();
}
如果我更改"response" => test,更新它大約需要 5/10 分鐘。像那樣做開發是一場噩夢。
我嘗試了很多東西,但似乎沒有任何效果
uj5u.com熱心網友回復:
花了我一天的時間。由于我使用的是 Mamp pro,我必須處理這個https://documentation-4.mamp.info/en/MAMP-PRO-Mac/Languages/PHP/index.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/528157.html
