Re: [PATCH 3/3] gitweb: use new Git::Repo API, and add optional caching

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jakub Narebski
Date: Monday, July 14, 2008 - 2:23 pm

On Fri, 11 July 2008, Lea Wiemann wrote:


Good.

It was suggested to split this into separate commit from the following 
change, for making it easier to test (you can check that behavior is
the same, with the exception of error handling) and review (smaller
patch to read and review).
 

As it was said, if feasible it would be good idea to put this change
into separate commit.


I understand that this change deals with treating invalid specifiers,
which point to either object that do not exists, are ambiguous, or point 
to object of invalid type.  Gitweb does check "syntactic" validity of 
input (of CGI parameters) already, even those that are not used for 
selected action.

BTW. such check was not feasible before implementing --batch and/or 
--batch-check options to git-cat-file; I think that possibly one more 
fork is not much price to pay for better error checking.


Good.  The only thing that *might* be controversial is putting empty
projects at the bottom of sorted by age (by last change) projects list, 
instead of at top.


I don't think it is a good change.

Gitweb generates two types of views (pages): transient and immutable.
An example of transient view (transient page/action) is for example RSS 
feed, or summary page.  When project (repository) is updated, they can 
change.

The opposite are immutable pages.  They are pages/actions/views where 
all specifiers are given by full SHA-1; to be more exact all specifiers 
that are needed to reconstruct object are given by SHA-1.  (It is 
enough to have sufficient check for immutability, i.e. such that if 
check succeeds, then page is immutable, but it doesn't need to be true 
in reverse.)

Gitweb sets expires to '+1d' which is one day to pages it considers 
immutable, while not defining expires for other pages (which results,
I think, in lack of expires header).  We could have set it to "forever", 
which in terms of Expires: HTTP header is half a year (from what
I remember).

Now I don't see *any* reason to not set long expires for immutable 
pages; I don't know if forbidding to cache transient pages even if in 
fact they are generated dynamically is a good idea...  Note that if 
caching is enabled, you can set expires to either time-to-expire of 
cache entries (simpler), or time left to live to invalidation of item 
in cache (better, but more complicated) perhaps also setting Age: 
header to appropriate value.


Sidenote: we would probably want to use Expires: for HTTP/1.0 requests, 
and Cache-Control: max-age=<seconds> for HTTP/1.1 requests.  But that 
might be left as improvement for later...


Great idea!
 

Nice.


IIRC you can use any Cache::Cache compatibile (is it explained later 
what it means?) cache here; IMVHO it would be nice if this info would 
be also in commit message.


Errr... I understand that it is your _private_ configuration, just 
copied here verbatim, but I don't think '/home/lewiemann/gitweb-cache'
is a good example: '/tmp/gitweb-cache' perhaps, that I can understand.


What should be used in production? "$cache_key = $version;"?

Besides hardcoding those paths is not a good idea.  You can always
use $ENV{'SCRIPT_FILENAME'}, or dirname of it.


Errr... what does "$page_info = <n>;" mean?


Nice.  Thanks.

[...]

Very good.


[Comments on patch itself in separate email, later]
-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/3] Git::Repo API and gitweb caching, Lea Wiemann, (Thu Jul 10, 6:06 pm)
[PATCH 2/3] add new Git::Repo API, Lea Wiemann, (Thu Jul 10, 6:11 pm)
Re: [PATCH 0/3] Git::Repo API and gitweb caching, Johannes Schindelin, (Thu Jul 10, 6:21 pm)
Re: [PATCH 0/3] Git::Repo API and gitweb caching, Jakub Narebski, (Fri Jul 11, 2:33 am)
Re: [PATCH 0/3] Git::Repo API and gitweb caching, Lea Wiemann, (Fri Jul 11, 7:07 am)
Re: [PATCH 0/3] Git::Repo API and gitweb caching, Abhijit Menon-Sen, (Fri Jul 11, 9:27 am)
Re: [PATCH 0/3] Git::Repo API and gitweb caching, Jakub Narebski, (Sat Jul 12, 8:08 am)
Re: [PATCH 2/3] add new Git::Repo API, Jakub Narebski, (Sun Jul 13, 4:28 pm)
Re: [PATCH 2/3] add new Git::Repo API, Petr Baudis, (Sun Jul 13, 6:40 pm)
Re: [PATCH 2/3] add new Git::Repo API, Lea Wiemann, (Sun Jul 13, 7:29 pm)
Re: [PATCH 3/3] gitweb: use new Git::Repo API, and add opt ..., Jakub Narebski, (Mon Jul 14, 2:23 pm)
Re: [PATCH 2/3] add new Git::Repo API, Lea Wiemann, (Mon Jul 14, 3:19 pm)
Re: [PATCH 2/3] add new Git::Repo API, Jakub Narebski, (Mon Jul 14, 4:41 pm)
Re: [PATCH 2/3] add new Git::Repo API, Lea Wiemann, (Mon Jul 14, 5:11 pm)
Re: [PATCH 3/3] gitweb: use new Git::Repo API, and add opt ..., Johannes Schindelin, (Mon Jul 14, 6:28 pm)
Re: [PATCH 2/3] add new Git::Repo API, Jakub Narebski, (Wed Jul 16, 11:21 am)
Re: [PATCH 2/3] add new Git::Repo API, Lea Wiemann, (Wed Jul 16, 1:32 pm)
Re: [PATCH 2/3] add new Git::Repo API, Jakub Narebski, (Thu Jul 17, 4:49 pm)
Re: [PATCH 2/3] add new Git::Repo API, Lea Wiemann, (Fri Jul 18, 6:40 am)
Re: [PATCH 2/3] add new Git::Repo API, Jakub Narebski, (Fri Jul 18, 8:35 am)
Re: [PATCH 2/3] add new Git::Repo API, Petr Baudis, (Fri Jul 18, 9:48 am)
Re: [PATCH 2/3] add new Git::Repo API, Lea Wiemann, (Fri Jul 18, 9:51 am)
Re: [PATCH 2/3] add new Git::Repo API, Petr Baudis, (Fri Jul 18, 9:54 am)
Re: [PATCH 2/3] add new Git::Repo API, Jakub Narebski, (Fri Jul 18, 10:05 am)
Re: [PATCH 2/3] add new Git::Repo API, Petr Baudis, (Fri Jul 18, 10:17 am)
Re: [PATCH 2/3] add new Git::Repo API, Lea Wiemann, (Fri Jul 18, 11:09 am)
Re: [PATCH 2/3] add new Git::Repo API, Petr Baudis, (Fri Jul 18, 11:19 am)
Re: [PATCH 2/3] add new Git::Repo API, Johannes Schindelin, (Fri Jul 18, 11:23 am)
Re: [PATCH 2/3] add new Git::Repo API, Jakub Narebski, (Fri Jul 18, 5:03 pm)
Re: [PATCH 0/3] Git::Repo API and gitweb caching, Lea Wiemann, (Fri Jul 18, 10:35 pm)
Re: [PATCH 2/3] add new Git::Repo API, Jakub Narebski, (Sat Jul 19, 12:07 pm)
Re: Statictics on Git.pm usage in git commands (was: [PATC ..., Johannes Schindelin, (Sun Jul 20, 3:38 am)
Re: Statictics on Git.pm usage in git commands (was: [PATC ..., Johannes Schindelin, (Sun Jul 20, 5:33 am)
Re: Statictics on Git.pm usage in git commands (was: [PATC ..., Johannes Schindelin, (Sun Jul 20, 6:21 am)
Re: [PATCH 2/3] add new Git::Repo API, Petr Baudis, (Sun Jul 20, 2:36 pm)
Re: [PATCH 2/3] add new Git::Repo API, Jakub Narebski, (Sun Jul 20, 2:50 pm)
Re: [PATCH 0/3] Git::Repo API and gitweb caching, Lea Wiemann, (Mon Aug 18, 12:34 pm)