Running Nginx 1.5.7 on Freebsd 9.1
with php-pfm 5.5.3
a wordpress site is “micro-cached” , but for some strange reason and not
always , some pages ( wordpress post or pages even 3 or 7 days after
their publication) are rendered for some users ( me and others and not
always the same, with different browsers) as blank pages and the same
connexion can read other cached pages/post with no problems.
The size of the global site in /cache is 72 Kb. Very small indeed.
The bad cached pages are logged like this :
“GET /url HTTP/1.1” 200 31
always 200 as a result code, and 31 for its size… 31 is not the actual
size of the page of course.
If a refresh my local cache ( SHIFT CMD-R) on chrome , the correct page
is reloaded and cached in /cache/x/y/somefile by nginx.
On Sat, Nov 23, 2013 at 11:00:52AM +0100, Ronald Van A. wrote:
The size of the global site in /cache is 72 Kb. Very small
nginx.
Any help ?
Size is suspiciously small, and I would suggest it’s some error
returned by php.
You may try adding $upstream_cache_status to access log to get
some more details (likely there will be MISS or similar state
there, indicating the response was returned by a php). If it
doesn’t help, some more hints about debugging can be found here:
On Mon, Nov 25, 2013 at 04:47:04PM +0100, Ronald Van A. wrote:
It seems related to every update on a post and the use of the WP plugin
Nginx-Helper
From a description of the plugin, it looks like it is expected to
work with 3rd party cache purge module. It may explain things if
you don’t have the module compiled. Just switching off the
pluging is probably a best solution.
if i add $upstream_cache_status to the log format , nothing is logged.
Should i recompile Nginx 1.5 with some additional modules ?
On the Freebsd port we have :
[ ] HTTP_UPSTREAM_FAIR 3rd party upstream fair module
[ ] HTTP_UPSTREAM_HASH 3rd party upstream hash module
[ ] HTTP_UPSTREAM_STICKY 3rd party upstream sticky module
which do I have to select ?
You don’t need these modules. If $upstream_cache_status isn’t
logged, it’s most likely a problem in your configuration - e.g.,
the log format you’ve modified isn’t used by your access_log
directive.
So the cache purge is compiled in. It may need to be configured
to work properly with Nginx-Helper plugin though, take a look at
plugin docs.
I suspect the reason for small responses returned from cache (as
your other messages indicate) is a special purge request which
isn’t handled cache purge module but passed back to php, and an
error message returned is cached.
As already suggested, if you are not familiar with nginx
configuration it might be good idea to just switch off the plugin.