Re: [PATCH/RFC] gitweb: allow configurations that change with each request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Nieder wrote:
> Jakub Narebski wrote:
> 
> > One solution I can think of (still backwards incompatibile) would be to
> > provide $per_request_config variable, which would hold anonymous sub
> > with parts of config that need to be done per request (this should work
> > with global variables (our), but I think it wouldn't work with lexical
> > variables (my)).  For example gitolite's contrib/gitweb/gitweb.conf would
> > then include:
> > 
> >   $per_request_config = sub {
> >   	$ENV{GL_USER} = $cgi->remote_user || "gitweb";
> >   }
> 
> How would that interact with caching?  i.e., how would whatever caching
> engine is used learn that $cgi->remote_user is part of the key needed to
> uniquely determine a response?

Well, obviously caching itself, including generating cache key, would be
done per-request.  It is only *initializing* cache (i.e. require + 
+ $cache->new()) that should be done once per run and not once per 
request.

But nevermind, this might be not much of a problem.  I'll start with
cache re-initialized on each request for start.

-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]