[RFC PATCHv3 00/10] gitweb: Simple file based output caching

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

 



This 10 patches long patch series is intended (yet) as preliminary version
for splitting large 'gitweb: File based caching layer (from git.kernel.org)'
mega-patch by John 'Warthog9' Hawley aka J.H., by starting small and
adding features piece by piece.

This is third version (third release) of this series, and is available on
http://repo.or.cz/w/git/jnareb-git.git as 'gitweb/cache-kernel-v3' branch.
Earlier versions are available there as branches 'gitweb/cache-kernel'
and 'gitweb/cache-kernel-v2'.  Previous version of this series was sent
to git mailing list as:
* [RFC PATCHv2 00/10] gitweb: Simple file based output caching
  Message-Id: <1265711427-15193-1-git-send-email-jnareb@xxxxxxxxx>
  http://thread.gmane.org/gmane.comp.version-control.git/139382

This version tries to do without 
  gitweb: Print to explicit filehandle (preparing for caching)
patch (or its equivalent).  It does it by "capturing" output by changing
default filehandle (used for "print", "printf" and "write" without explicit
filehandle) via 'select($data_fh);' to point to in-memory file.  This is
simplest possible solution, and does not require extra Perl modules.

Among other solutions are tie-ing *STDOUT to a class that captures output
(similar to what CGI::Cache does), or using PerlIO layers via push_layer() /
pop_layer() methods from (non-core) PerlIO::Util module (from CPAN).

This version also includes thorough (perhaps too thorough) error checking,
it has much more comments, should work correctly when two clients access the
same URL with an error condition (die_error is called), and it detaches
background process so even with mod_perl it would not generate zombies.

This version was tested a bit running under mod_cgi: that it generates page
correctly, that it gets page from cache, that cache expires correctly, that
stale page is being served, that "Generating..." page is generated correctly
and that it works.


There are a few KNOWN ISSUES: 'blame_incremental' action is not incremental
and does not work (perhaps JavaScript-based actions should be turned off
with current implementation of output cache?), and "Generating..." page
somehow does not get additional "." when waiting (but it works).


The following changes since commit 7e5eb8f1834722507e2d2171a253b78b1d924458
(in the 'master' branch of git.git repository):
  Junio C Hamano (1):
        Merge branch 'maint'

are available in the git repository at:

  git://repo.or.cz/git/jnareb-git.git gitweb/cache-kernel-v3

Shortlog:
~~~~~~~~~
Jakub Narebski (10):
  gitweb: href(..., -path_info => 0|1)
  gitweb/cache.pm - Very simple file based cache
  gitweb/cache.pm - Stat-based cache expiration
  gitweb: Use Cache::Cache compatibile (get, set) output caching
  gitweb/cache.pm - Adaptive cache expiration time
  gitweb: Use CHI compatibile (compute method) caching
  gitweb/cache.pm - Use locking to avoid 'cache miss stampede' problem
  gitweb/cache.pm - Serve stale data when waiting for filling cache
  gitweb/cache.pm - Regenerate (refresh) cache in background
  gitweb: Show appropriate "Generating..." page when regenerating cache

Diffstat:
~~~~~~~~~
 gitweb/README                          |   70 ++++
 gitweb/cache.pm                        |  655 ++++++++++++++++++++++++++++++++
 gitweb/gitweb.perl                     |  321 +++++++++++++++-
 t/gitweb-lib.sh                        |    2 +
 t/t9500-gitweb-standalone-no-errors.sh |   19 +
 t/t9503-gitweb-caching.sh              |   32 ++
 t/t9503/test_cache_interface.pl        |  404 ++++++++++++++++++++
 t/test-lib.sh                          |    3 +
 8 files changed, 1486 insertions(+), 20 deletions(-)
 create mode 100644 gitweb/cache.pm
 create mode 100755 t/t9503-gitweb-caching.sh
 create mode 100755 t/t9503/test_cache_interface.pl

-- 
Jakub Narebski

git version 1.6.6.1
--
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]