/albums/ on a different server?

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

  • trisweb Administrator
    Might be possible, but hard to do, and NOT efficient or reccomended. All of zenphoto runs off the filesystem, so every function scours the disk for its folder structure and images, which directly becomes the albums you see. Running the code on a separate server without the images would be approximately 50 times slower, and load times would be unbearable.

    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. :)
  • The host could easily run ZP but i didnt want to have such a big part of my site hosted on another server :(

    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.
  • Hey Tris, this is exactly the same kind of situation I am facing. I have a php server and an image server. Except that the image server is simply an image hosting account and does not have any processing abilities. I do not even think my php server will be able to write files to the image server.

    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!
  • trisweb Administrator
    Nope, doesn't work like that. Zenphoto is filesystem-based. Get some real hosting that gives you what you need ;-)

    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.
  • I'm considering making the filesystem API more generic for version 2
    I think you misunderstood me a little. I know you can't do it now, but would be keen to know you're thoughts on how it might be able to be done in the future. I could possibly help with the coding?
  • trisweb Administrator
    Ahh, okay, sorry :) I get the question a lot, so I just went away at answering it like I usually do.

    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 :)
Sign In or Register to comment.