We now do pay for static file serving, to Mirror Image Internet, Inc., but we are thinking on having a dedicated box to serve our static files. This is how we do it now, we are looking for some knowledge on how to set it up by ourselves: If original file is served from www.domain.com/originalfile.ext, we want to serve it from cache.domain.com/originalfile.ext We do CNAME the cache subdomain to the cache server. Here is how it behaves: If the file does not exist in cache server or it has expired it's cache time, it loads it from the original server and serves it, if not it serves it from the cache. Anyone has a idea on how is it done? (I now hard coding it may do, but maybe there is something already done)
Ok this is simple i would say 1) Create a A Record for the subdomain and point it to the IP Of the other server 2) Create a php file which checks if the file exist and if not what pic to display 3) Now using mod rewrite make it such that for file reuqest it first checks if the file exist and it not server the other file Hope u got the concept ??
Bohra Thanks Bohra, but the concept is not the problem, the problem is the implementation, if we do use php to check if file exists or not, if not wget it, and then serve it, we loose the "fast" side of not using php, we would use something like lighttpd, multithreaded static file serving... We are looking for something like vasyl said, but that behaves the way we need. Some kind of server software that can cache and serve remote files. I think I've seen the light, maybe I can use http://www.linux.com.cn/modcache/ what do u think?