Write a Simple Caching Proxy Server with PHP and Memcached
…y using ServerAlias blah.whatever.com lines. <VirtualHost *:80> ServerName www.remote.com DocumentRoot /var/www/cacheproxy <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /cacheproxy.php [L,QSA] </IfModule> </VirtualHost> Finally create a file under /var/www/cacheproxy/cacheproxy.php with the following. It assumes your memcache server is on localhost and port 11211, ca…