关闭 Magpie 缓存
我使用 magpie 从多个网站提取 RSS 提要。我将运行一个 cron 作业来执行此操作,因此想禁用缓存。我当然使用 php,并且想知道如何才能做到这一点。谢谢
Im using magpie to pull rss feeds from several websites. im going to run a cron job to do this so would like to disable caching. im using php ofcourse and was wondering how i can do this. Thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 rss_fetch.php 中找到了。滚动到 init() 函数并设置 Define('MAGPIE_CACHE_ON', true);定义('MAGPIE_CACHE_ON', false);
I found out in rss_fetch.php. scroll to init() function and set define('MAGPIE_CACHE_ON', true); to define('MAGPIE_CACHE_ON', false);
那(Lojik爵士的答案)会起作用,但你不应该破解 Magpie 代码本身,而是应该将定义语句放在调用 Magpie 的自己的代码中:
这将覆盖 Magpie 的设置(根据“if(!定义...”)代码中的内容),并且如果发布新版本,您将不需要记住再次破解 Magpie。
这也意味着您可以让某些脚本使用缓存,而其他脚本忽略缓存,如果该功能对您有用的话。你。
That (Sir Lojik's answer) will work, but rather than hack the Magpie code itself, you should put the define statement in your own code that calls Magpie:
That will override Magpie's setting (per the "if (!defined...." stuff in the code) and you won't need to remember to hack Magpie again should a new version ever be released.
It also means that you can have some scripts use the cache and other scripts ignore the cache, should that feature be useful to you.