[ic] Serving the images from a database

Lars Segerlund konsult at sebab.se
Thu May 6 04:43:41 EDT 2004


 Followup at the bottom of the page ..

Mike Heins wrote:

>Quoting Lars Segerlund (konsult at sebab.se):
>  
>
>>Has anyone served the images for interchange through the database ?
>>    
>>
>
>I have.
>
>  
>
>>I am thinking of putting a lot of images as BLOB's in an MySql database 
>>and perhaps caching them as files on the webserver/interchange server.
>>    
>>
>
>It works, but Interchange is not the fastest method for serving files.
>
>You could pretty easily make IC the 404 handler for images if you use
>Apache, and have it pull the image out and place it on the file system
>when requested.
>
>If you make "AcceptRedirect Yes" in interchange.cfg, IC will take
>Apache's redirects when you make it the handler for 404. You could
>intercept the request in Autoload, and:
>
>    * determine whether the request asks for an image/* MIME type
>    * pull the image out of the database and write it to disk
>    * deliver it with $Tag->deliver()
>
>Apache makes it relatively easy as I believe you get a PATH_TRANSLATED
>variable that tells you where the file should have been.
>
>  
>
>>I just wanted to know if this is done or there are any complications, I 
>>am fairly new to interchange so I'd rather ask before starting to 
>>implement, sorry for waisting the bandwidht.
>>    
>>
>
>No, that is an interesting application. It would certainly make it
>easier to transport a catalog, as finding the image path and 
>copying the images is one of the hardest part of moving the
>catalog around.
>
>  
>
 I had a really interesting idea about this now, if I get something like 
this to work, then perhaps I could make the server build the catalog 
from the db ?  Thus it would be trivial to set up a new instance of an 
existing catalog, by making the server populate it.
 The only thing I am unsure about is updates to the Images/Pages in the 
db and how to propagate them to the server, unless something intelligent 
is done about this this would be a problem.

 / Lars Segerlund.




More information about the interchange-users mailing list