如何启用FastCGIcachingdynamic更新页面相关的数据?

我在使用FastCGIcaching的NGINX服务器上使用基于php的博客。 没有这个caching,很容易更新页面浏览与每个页面加载一个特定的url。 当FastCGIcaching处于运行状态时,浏览量不会更新。

我正在考虑实现基于像素的跟踪,所以当该页面不在caching中并获取cachingMISS时,请求将打到实际页面,然后我可以借助访问日志(24小时)更新浏览量。

这将是好的或任何人都可以build议一个更好的解决方法来实现这一目标?

首先,你需要检查你的nginx是否有nginx -V 2>&1 | grep nginx-cache-purgecaching清除模块 nginx -V 2>&1 | grep nginx-cache-purge如果是,则将下面的代码块添加到你的nginx conf中。

 location ~ /purge(/.*) { fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1"; } 

现在如果你想更新任何页面,通过访问url清除它的caching假设http://example.com/purge/abcd/abc.php它将清除caching的页面http://example.com/abcd/abc.php