Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我fetch_feed()用来解析 RSS 提要。fetch_feed()自动缓存。
fetch_feed()
如何测试我的提要是否以正确的时间间隔缓存?缓存的默认位置在哪里?
我已经使用 wp_feed_cache_transient_lifetime 挂钩来设置时间间隔。
默认情况下, SimplePie 将缓存的文章存储在/cache目录中,尽管他们的文档指出:“SimplePie 包含一个缓存系统,可以与基于文件的缓存、数据库缓存或 Memcache 支持的缓存系统一起使用。”
/cache
默认缓存持续时间为一小时(3600 毫秒)。set_cache_duration但是,您可以使用该功能覆盖它。确保您将缓存文件夹权限设置为至少 755。
set_cache_duration