A few days ago I wrote about how to configure Wordpress to use Google’s cache proxy servers to serve images. After writing that entry I kept thinking to myself that there had to be a better/easier way to accomplish this other than changing Wordpress settings. Well I finally figured it out and got it working on my other blog DavidChiu.net. It involves using mod_rewrite and symbolic links. First you need to create a symbolic link to the Wordpress /uploads/ folder. For example:
ln -s wp-content/uploads/ images/cache
Then you just need to modify your .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^.*wp-content/uploads(.*) http://gmodules.com/ig/proxy?url=http://davidchiu.net/images/cache$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
And voila! All images will now be served by Google’s proxy cache!
I was doing some research into using Amazon’s S3 storage as a cheap CDN alternative to Akamai, but various people around the web have reported hiccups and problems with the service giving indication that Amazon’s service is not quite mature enough. On the other hand I discovered some discussions on using Google’s Gadget Ad platform for caching images.
[user@server ~]$ sudo nmap -sS -O 10.100.188.15
Password:
Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2008-04-25 19:14 EDT
Interesting ports on server (10.100.188.15):
(The 1650 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
111/tcp open rpcbind
199/tcp open smux
631/tcp open ipp
808/tcp open ccproxy-http
946/tcp open unknown
2301/tcp open compaqdiag
8009/tcp open ajp13
8080/tcp open http-proxy
MAC Address: 00:16:35:D4:BE:C2 (Unknown)
Device type: general purpose
Running: Linux 2.4.X
OS details: Linux 2.4.20 (Itanium)
Uptime 15.153 days (since Thu Apr 10 15:34:08 2008)
Nmap run completed — 1 IP address (1 host up) scanned in 2.301 seconds
[root@server ~]# date 042511082008
Fri Apr 25 11:08:00 PDT 2008
I was having caching problems with the search functionality across two of my MovableType blogs. At first I thought it was a problem with the FastSearch plugin I was using. But my other blog was having similar problems and was not using the FastSearch plugin. It turns out that I had the page caching option enabled in mtview.php:
$mt->caching = true;
Once I commented out this line the search worked fine.
I also noticed that in migrating over my blogs from MovableType 3 to MovableType 4, MT4 created a different naming convention - leaving all the old MT3 files in the archive directories. So I decided to delete all the archive files and just rebuild/republish the site. I needed a Linux command that would recursively go through all the directories and delete all php files. After consulting google I found my answer:
find . -name \*.php -exec rm {} \;