This is part two in my caching series. Part one covered the concept behind the full page caching as well as potential problems to keep in mind. This part will focus on implementing the concept in actual PHP code. By the end of this you’ll have a working implementation that can cache full pages and invalidate them intelligently when an update happens.
Technology
Nginx Primer 2: From Apache to Nginx
How to Solve “No input file specified” with PHP and Nginx
“No input file specified” is one of the most frequently encountered issues in Nginx. This is actually an error from PHP and due to display_errors being 0ff people will often just get a blank page with no output. The root cause of the error is that PHP cannot find the file Nginx is telling it to look for, and there are a few common cases that causes this.
12,000 Requests per second with Nginx, PHP and Memcached
Caching in PHP is usually done on a per-object basis, people will cache a query or some CPU intensive calculations to prevent redoing these CPU intensive operations. This can get you a long way. I have an old site which uses this method and gets 105 requests per second on really old hardware. The method I propose will net you a solid 12,000 requests per second.
PHP Namespace Mindfuck
I love PHP, I really do… just, sometimes you fall into these situations where you just can’t help bang your head against the table until even the table starts bleeding.
Book Review: Nginx HTTP Server
Nginx HTTP Server is a new book by ClĂ©ment Nedelcu and published by Packt Publishing, it’s the first English book about Nginx to be available for purchase. Previously users had to depend on the wiki and various blogs for documentation; before that IRC and the mailing list. All aspects of Nginx have undergone huge growth, from the feature set to the user base and finally to the documentation. This book fills an important area in Nginx documentation that has been missing, a hard copy of coherent logical steps that documents the Nginx HTTP server. The wiki is a great source of information, but it’s difficult to print out easily readable material to bring on the train or bus to work, or even if you just want to sit down with a cup of tea and read.