Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Simplepie fetch_feed()管理RSS缓存_Rss_Simplepie - Fatal编程技术网

使用Simplepie fetch_feed()管理RSS缓存

使用Simplepie fetch_feed()管理RSS缓存,rss,simplepie,Rss,Simplepie,rss文件更新后,如何强制刷新?无论发生什么情况,它似乎都在缓存 提要位于WordPress仪表板小部件中,使用simplepie fetch_feed()方法 /* Dashboard Widget */ function my_dashboard_widget_function() { $rss = fetch_feed( "http://mysite.com/feed.rss" ); if ( is_wp_error($rss) ) { if (

rss文件更新后,如何强制刷新?无论发生什么情况,它似乎都在缓存

提要位于WordPress仪表板小部件中,使用simplepie fetch_feed()方法

/* Dashboard Widget */
function my_dashboard_widget_function() { 
    $rss = fetch_feed( "http://mysite.com/feed.rss" );

     if ( is_wp_error($rss) ) {
          if ( is_admin() || current_user_can('manage_options') ) {
               echo '<p>';
               printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
               echo '</p>';
          }
     return;
}
/*仪表板小部件*/
函数my_dashboard_widget_function(){
$rss=获取订阅源(“http://mysite.com/feed.rss" );
如果(是错误($rss)){
如果(是_admin()| |当前_用户_can('manage_options')){
回声“”;
printf('RSS Error:%s'),$RSS->get_Error_message();
回声“

”; } 回来 }
添加过滤器('wp\u feed\u cache\u transient\u life',创建函数('$a','return 3600;')

//其中3600是以秒为单位的缓存持续时间