简体   繁体   English

Facebook,停止缓存页面,怎么办?

[英]Facebook, stop caching a page, how to?

Lets say, I have an article which supposed to be shown next week, for an hour. 可以说,我有一篇文章应该在下周播放一个小时。 When viewing this article, it defends itself: 查看本文时,它会为自己辩护:

if ($post->date < NEXT WEEK || $post->date > NEXT WEEK)
{
    header("HTTP/1.1 301 Moved Permanently");
    header('Location: http://example.com/404');
    exit();
}

this works very good but sadly a sitemap is working around here or whatever. 效果很好,但遗憾的是,站点地图正在此处或附近运行。 Facebook still caches that 404 page. Facebook仍会缓存该404页面。 How to ask facebook not to cache that page? 如何要求Facebook不缓存该页面?

Add follow strings: 添加跟随字符串:

header("Cache-Control: no-store, no-cache, must-revalidate");
header("Expires: " . date("r"));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM