Is it possible to have my /albums/ dir hosted on a different server?
the reason i ask, is that i have 2 hosting accounts, one with loads of space but no features and one with no space, but loads of features. so i'd like to host my /albums/ on the huge host i have, but have all the scripts running on my little host?
possible? or ways round?
Comments
Are you sure you can't put ZP on the host with more space? It requires pretty standard features, and if the host doesn't have them, it couldn't hurt to ask.
I've got things to mull over, I dont have the small hosting yet, and am on the lookout for a more suitable host. But it gives me things to think about.
So, what I was thinking was something like this: upload the images to the php server, organise them and resize them, then take all the processed zenphoto directories and move them to the image server. And somehow update the database so it knowes where the new links are. I was reading this thread and got some ideas but would appreciate any guidance you could offer.
Thanks!
Since this seems to be in high demand, I'm considering making the filesystem API more generic for version 2, for example, to be able to run with files off either other servers or services like www.box.net . That's way in the future though, don't expect anything soon.
It'll take some thinking through... and since every dual-server configuration would be different, it would be very difficult. That's why I don't think it's worth spending much time on... I want to keep ZP simple and all that, you know.
It's not as simple as moving the directories and updating the database -- the processed images aren't even stored in the database. The image processor goes and looks for their existence on the filesystem first, and if they don't exist then it reprocesses them.
There would be many advantages to storing that value in the database once it's cached, but it would still require a file check just to be sure, in case the image has been deleted or something. I'd like to keep the dynamic nature of the image processing, and never succumb to the "do it all when uploading" way. I think the image processor is one of zenphoto's biggest strengths.
Anyway, to use files from a different server, they would have to be downloaded to the processing server, resized, stored somewhere (cached either remotely or locally) and the URL returned to the user wherever that final location may be. It would be useful (if we knew the processed images were never deleted) to store the cached URLs in the database somehow, so that there were no remote file operations for each image (which are orders of magnitude slower than local file ops).
It would be fun to find ways to optimize the whole process, but still, I don't think it's worth my time. If you want to try, go right ahead and keep us updated with your progress