# Blank page on some micro-cached pages

**URL:** <https://www.ruby-forum.com/t/blank-page-on-some-micro-cached-pages/237671>\
**Category:** NGINX\
**Created:** [November 23, 2013, 11:01am UTC](https://www.ruby-forum.com/t/blank-page-on-some-micro-cached-pages/237671 "2013-11-23T11:01:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [November 23, 2013, 11:01am UTC](https://www.ruby-forum.com/t/blank-page-on-some-micro-cached-pages/237671/1 "2013-11-23T11:01:39Z")

</div>

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.

Any help ?

Some config :

fastcgi\_cache\_path /cache/nginx levels=1:2 keys\_zone=microcache:5m  
max\_size=2000m;  
sendfile on;  
sendfile\_max\_chunk 512K;  
aio sendfile;  
tcp\_nopush on;  
read\_ahead 256K;

open\_file\_cache max=1000 inactive=20s;  
open\_file\_cache\_valid 30s;  
open\_file\_cache\_min\_uses 2;  
open\_file\_cache\_errors on;

keepalive\_timeout 120;  
keepalive\_requests 10000;

client\_max\_body\_size 2m;

gzip on;  
gzip\_buffers 48 8k;  
gzip\_comp\_level 4;  
gzip\_http\_version 1.0;  
gzip\_vary on;  
gzip\_disable “MSIE [1-6].(?!.\*SV1)”;  
gzip\_proxied any;  
gzip\_types text/plain text/css application/x-javascript text/xml  
application/xml application/xml+rss text/javascript;

---

<div class="post-metadata">

**Author:** ![istos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/8797f3/32.png) [@istos](https://www.ruby-forum.com/u/istos)\
**Post date:** [November 25, 2013, 3:14pm UTC](https://www.ruby-forum.com/t/blank-page-on-some-micro-cached-pages/237671/2 "2013-11-25T15:14:00Z")

</div>

Hello!

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:

> **[Debugging | NGINX](https://www.nginx.com/resources/wiki/start/topics/tutorials/debugging/)**
>
> This tutorial explains how to use some of NGINX's essential debugging features.

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

---

<div class="post-metadata">

**Author:** ![istos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/8797f3/32.png) [@istos](https://www.ruby-forum.com/u/istos)\
**Post date:** [November 25, 2013, 4:48pm UTC](https://www.ruby-forum.com/t/blank-page-on-some-micro-cached-pages/237671/3 "2013-11-25T16:48:04Z")

</div>

It seems related to every update on a post and the use of the WP plugin  
Nginx-Helper

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 ?

Le 25 nov. 2013 15:13, Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) a crit :

---

<div class="post-metadata">

**Author:** ![istos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/8797f3/32.png) [@istos](https://www.ruby-forum.com/u/istos)\
**Post date:** [November 25, 2013, 5:11pm UTC](https://www.ruby-forum.com/t/blank-page-on-some-micro-cached-pages/237671/4 "2013-11-25T17:11:29Z")

</div>

Hello!

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.

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)

---

<div class="post-metadata">

**Author:** ![istos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/8797f3/32.png) [@istos](https://www.ruby-forum.com/u/istos)\
**Post date:** [November 25, 2013, 5:24pm UTC](https://www.ruby-forum.com/t/blank-page-on-some-micro-cached-pages/237671/5 "2013-11-25T17:24:56Z")

</div>

Well nginx 1.5.7 is compiled with this 3 party module :

configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt=‘-I  
/usr/local/include’ --with-ld-opt=‘-L /usr/local/lib’  
–conf-path=/usr/local/etc/nginx/nginx.conf  
–sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid  
–error-log-path=/var/log/nginx-error.log --user=www --group=www  
–with-file-aio --with-ipv6  
–http-client-body-temp-path=/var/tmp/nginx/client\_body\_temp  
–http-fastcgi-temp-path=/var/tmp/nginx/fastcgi\_temp  
–http-proxy-temp-path=/var/tmp/nginx/proxy\_temp  
–http-scgi-temp-path=/var/tmp/nginx/scgi\_temp  
–http-uwsgi-temp-path=/var/tmp/nginx/uwsgi\_temp  
–http-log-path=/var/log/nginx-access.log  
–add-module=/usr/ports/www/nginx-devel/work/ngx\_cache\_purge-2.1  
–with-http\_geoip\_module --with-http\_stub\_status\_module --with-pcre

Le 25 nov. 2013 17:11, Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) a crit :

---

<div class="post-metadata">

**Author:** ![istos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/8797f3/32.png) [@istos](https://www.ruby-forum.com/u/istos)\
**Post date:** [November 25, 2013, 5:12pm UTC](https://www.ruby-forum.com/t/blank-page-on-some-micro-cached-pages/237671/6 "2013-11-25T17:12:40Z")

</div>

Oups anwser to myself : ADDED the $upstream\_cache\_status to the LOG :  
the page are empty , still a 200 RESULT CODE and a HIT with a 31 byte  
size.

myIP - - [25/Nov/2013:17:04:35 +0100] “GET /allairgoo HTTP/1.1” 200 HIT  
31 “[http://truc/](http://truc/)” " Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_9\_0)  
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57  
Safari/537.36" “-”  
myIP - - [25/Nov/2013:17:04:50 +0100] “GET /allairgoo HTTP/1.1” 200 HIT  
31 “[http://truc/](http://truc/)” " Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_9\_0)  
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57  
Safari/537.36" “-”

Le 25 nov. 2013 16:47, Ronald Van A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) a crit :

---

<div class="post-metadata">

**Author:** ![istos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/8797f3/32.png) [@istos](https://www.ruby-forum.com/u/istos)\
**Post date:** [November 25, 2013, 9:46pm UTC](https://www.ruby-forum.com/t/blank-page-on-some-micro-cached-pages/237671/7 "2013-11-25T21:46:06Z")

</div>

Hello!

On Mon, Nov 25, 2013 at 05:24:32PM +0100, Ronald Van A. wrote:

> Well nginx 1.5.7 is compiled with this 3 party module :
> 
> configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt=‘-I  
> /usr/local/include’ --with-ld-opt=‘-L /usr/local/lib’  
> –conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx  
> –pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www  
> –group=www --with-file-aio --with-ipv6  
> –http-client-body-temp-path=/var/tmp/nginx/client\_body\_temp  
> –http-fastcgi-temp-path=/var/tmp/nginx/fastcgi\_temp  
> –http-proxy-temp-path=/var/tmp/nginx/proxy\_temp  
> –http-scgi-temp-path=/var/tmp/nginx/scgi\_temp  
> –http-uwsgi-temp-path=/var/tmp/nginx/uwsgi\_temp  
> –http-log-path=/var/log/nginx-access.log  
> –add-module=/usr/ports/www/nginx-devel/work/ngx\_cache\_purge-2.1  
> –with-http\_geoip\_module --with-http\_stub\_status\_module --with-pcre

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.

–  
Maxim D.  
[http://nginx.org/en/donation.html](http://nginx.org/en/donation.html)
