Open Benno007 opened 11 years ago
Is this a question or an error reporting? For questions please use the mailing lists or stackoverflow.
Sorry, I’m not sure. Is it expected behaviour to cache pages with completely empty contents? Wouldn’t that be kind of useless?
I’ve tried posting on SO and no one has been able to tell me what’s wrong.
From: Frank Brückner Sent: Friday, May 31, 2013 4:07 PM To: zendframework/zf1 Cc: Ben Subject: Re: [zf1] Zend Page Cache - saved cache is empty (#113)
Is this a question or an error reporting? For questions please use the mailing lists or stackoverflow.
— Reply to this email directly or view it on GitHub.
Somehow, Zend Page Cache is able to cache completely empty pages (that should have content). The $data it saves can be completely empty in certain circumstances.
I have no idea how it happens, but one way is from a server performing a HEAD request on a page. It seems to save the empty response body of the HEAD request to a cache file. I've seen this by adding logging where it posts the $_SERVER variables to the text file along with the $data. $data is empty, but $_SERVER['REQUEST_METHOD'] is HEAD.
Other ways the cache is sometimes empty seems to be from Baidu spider and yandex spider. I honestly cannot figure this out.
Due to the nature of the page cache dieing after it echo's the $data on _flush, this results in an empty page being served to users. I've had to modify _flush to add:
if(empty($data)) return true; else die();
Has anyone else ever experienced this? Is there any other way to fix it?