November 05, 2010 12:49AM

We are successfully using fastcgi_cache on our PHP application. We currently have 5 servers in the farm, which means it currently takes 5x as long to build up the cache after each purge/timeout.

Is there anyway to share the cache index/files across servers? I have not tried rsync'ing the cache folders between machines but doubt that would work, since the files would not exist in the index.

Separately, two lessons we learned.

1) PHP files that contain a redirect with header("Location: new-url") and immediately exited will not redirect properly when served from the cache, due to PHP appending a Content-type. If print some text between the header and exit it works fine.

Does not work:
^A^F^@^A^@?^D^@Status: 301 Moved Permanently^M
Content-type: text/html

^A^F^@^A^@?^D^@Status: 301 Moved Permanently^M
Content-type: text/html^M

2) fastcgi_cache will sometimes cache "blank" pages, likely due to our backend acting up. We implemented a cronscript that runs every minute and purges cache files < 512 byes that are not redirects.
Subject Author Posted

fastcgi_cache replication?

marcusadolfsson November 05, 2010 12:49AM

Re: fastcgi_cache replication?

Maxim Dounin November 05, 2010 07:20AM

Re: fastcgi_cache replication?

Dennis Jacobfeuerborn November 05, 2010 08:26AM

Re: fastcgi_cache replication?

Maxim Dounin November 05, 2010 08:42AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 181
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready