[pLog-svn] resserver usage

Mark Wu markplace at gmail.com
Wed Oct 4 03:38:56 GMT 2006


I think maybe x-sendfile is an alternative way. Take a look at the following
links:

http://blog.thinkphp.de/plugin/tag/lighttpd
http://wiki.rubyonrails.org/rails/pages/HowtoSendFilesFast
http://celebnamer.celebworld.ws/stuff/mod_xsendfile/

1. Maybe we can add this as an alternative option. So, if user install
mod_x_sendfile, we can send the file through x_sendfile header instead of
php put.
2. Maybe we can simplify our resserver.php. Change it to a single exist
script instead of depends on those DAOs, Actions, Views, ..... But it might
be break some principle of lifetype framework ... :(

I personally like to keep the script there. Not for compatability, it is for
access permission. Without wraping with php script, it is not easy to do the
access control.

And, I only has one concern about plugin/mod_rewrite method.

If I have 10000 blogs, will the rules grows to 10000 rules? Will this casue
the apache performance down?

Mark 

> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net 
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
> Sent: Wednesday, October 04, 2006 5:58 AM
> To: plog-svn at devel.lifetype.net
> Subject: Re: [pLog-svn] resserver usage
> 
>  	Hrm - I hadn't thought about these cases - I don't 
> usually use the full-picture links, just the thumbnails and 
> stuff, so it just shows in a page, ie. the user never sees 
> the real URL to it.
> 
> On Tue, 3 Oct 2006, Oscar Renalias wrote:
> 
> > I was also considering using a 30x redirect but I am not sure what 
> > will happen with the file name. What I mean is that if somebody 
> > requests /resource/myalbum/myfile.jpg and resserver.php does a 
> > redirect to /gallery/44/44-23.jpg, how will the browser 
> address look 
> > like? What name will the browser suggest when saving the file? 
> > myfile.jpg or 44-23.jpg? I guess 44-23.jpg would be kind of ugly, 
> > wouldn't it? But if we managed to keep the original file 
> name, this probably is the easiest option of all.
> >
> > On 3 Oct 2006, at 23:07, Jon Daley wrote:
> >
> >> 	That is interesting.  I wonder if it is possible to do 
> an *internal* 
> >> apache/mod_rewrite via php.  That way the user doesn't see the 
> >> 301/302 redirect, but our script doesn't have to write out 
> the image file.
> >> 	I think the 301/302 way would be alright as well - the 
> users would 
> >> only see the "real" url if they were doing spidering sorts of 
> >> activities, and would still be able to use "nice" urls, as well as 
> >> access control (except for the instance where people get 
> the "real" 
> >> URL, and then try to do stuff with it, although I am not sure what 
> >> they could do - guess file
> >> names?)
> >> 	The .htaccess could even only allow requests with a certain 
> >> referrer, or other environment variable, so only 
> redirected accesses 
> >> would be allowed
> >> - those types of checks might not be as available to 
> everyone as "regular" 
> >> rewrites, I am not sure.  I guess it is just apache, so probably 
> >> mod_rewrite is on or off, it isn't like we are dealing with php's 
> >> safe mode.
> >> 
> >> On Tue, 3 Oct 2006, Reto Hugi wrote:
> >>> - having some sort of access control to resources
> >>> - doing statistics through lifetye (not webserver access log)
> >>> - having nice urls for resources (?)
> >>> 
> >>> the first reason leaves not much space for alternatives, I think. 
> >>> PHP has to read the file and send it to the client.
> >>> 
> >>> But the other two may be done in a less resource intensive manner:
> >>> 
> >>> - using mod_rewrite (i like the plugin variant proposed by paul)
> >>> - redirecting the client through the script (not the 
> script reading 
> >>> the
> >>> resource)
> >>> 
> >>> I don't have a PoC for the last suggestion, but I assume, that we 
> >>> may safe reasonable amounts of server resources by only 
> asking the 
> >>> database for the correct direct url to the file and do a 
> 301 or 302 redirect.
> >>> downside is, that this needs changes to the core, IMO.
> >>> 
> >>> Challanges:
> >>> - can we improve performance and still have access control via 
> >>> lifetype (-> thinking about the new permission capabilities...)
> >>> - is redirecting a useful solution to improve performance?
> >>> 
> >>> oh well, not a very helpful post, just my thoughts :)
> >>> 
> >>> reto
> >>> _______________________________________________
> >>> pLog-svn mailing list
> >>> pLog-svn at devel.lifetype.net
> >>> http://devel.lifetype.net/mailman/listinfo/plog-svn
> >>> 
> >> 
> >> --
> >> Jon Daley
> >> http://jon.limedaley.com/
> >> 
> >> Talking much about oneself can also be a means to conceal oneself.
> >> -- Friedrich Nietzsche
> >> _______________________________________________
> >> pLog-svn mailing list
> >> pLog-svn at devel.lifetype.net
> >> http://devel.lifetype.net/mailman/listinfo/plog-svn
> >> 
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://devel.lifetype.net/mailman/listinfo/plog-svn
> 
> --
> Jon Daley
> http://jon.limedaley.com/
> 
> Needs are a function of what other people have.
> -- Jone's Principle
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn



More information about the pLog-svn mailing list