git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 2, 2010, 21:25 UTC
Message-ID
<201008022325.23670.jnareb@gmail.com>
In-Reply-To
<20100802210121.GA3072@burratino>
Jonathan Nieder wrote:
Show 16 quoted lines
> 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
Previous: Jonathan NiederNext: Jonathan Nieder
Message 12 of 15 in “Potential bug in gitweb 1.7.2”
  1. Julio LajaraJul 26, 2010
  2. Jonathan NiederJul 26, 2010
  3. Anders KaseorgJul 26, 2010
  4. Julio LajaraJul 26, 2010
  5. Jakub NarebskiJul 26, 2010
  6. Ævar Arnfjörð BjarmasonJul 26, 2010
  7. Julio LajaraJul 26, 2010
  8. Jakub NarebskiJul 26, 2010
  9. gitweb: allow configurations that change with each requestJonathan Nieder, Jul 31, 2010
  10. Jakub NarebskiAug 2, 2010
  11. Jonathan NiederAug 2, 2010
  12. Jakub NarebskiAug 2, 2010
  13. Jonathan NiederJul 26, 2010
  14. Anders KaseorgJul 26, 2010
  15. Jonathan NiederJul 27, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.