QUICK AND DIRTY Origin Pull CDN ALTERNATIVE W/ PHP AND HTACCESS
This is my quick and dirty attempt at a dynamic mirror content cache
first .HTACCESS in the root to check if the file exist
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) cacheme.php?url=$1 [R=301, L]
and our cacheme.php file to save the files to the new sever on the fly and server them one last time from the OG server with a 302 . . .
$ogfile = $_GET['url'];
$ogserverurl = 'http://example.com/'$ogfile;
$content = file_get_contents($ogserverurl);
file_put_contents($ogfile, $content);
header("Location: $ogserverurl");
now I can enable the CDN feature in WP Super Cache and use any CHEAP “UNLIMITED BANDWIDTH” host to serve up my images on the FLY ! ! ! !
HOPE THIS WORK . . . FINGERS CROSSED !!!