List for cgit developers and users
 help / color / mirror / Atom feed
From: beber at meleeweb.net (Bertrand Jacquin)
Subject: cache issue
Date: Sun, 23 Mar 2014 15:06:42 +0100	[thread overview]
Message-ID: <20140323140642.GF1223@lemonhead.scabb> (raw)

Hi,

I'm getting some trouble with cgit on enlightenment platforms and cache
since some time, but at it seems to be reproductable with cgit 0.10 here
is a report.

The cache configuration look like this :

cache-root=../cache
cache-size=10000
cache-static-ttl=1
cache-dynamic-ttl=1
cache-repo-ttl=1
cache-root-ttl=1
cache-scanrc-ttl=5

* Main page

$ curl -sD - -o /dev/null https://git.enlightenment.org/ \
  | grep -E '^(Date|Expires|Last-Modified): '
Date: Sun, 23 Mar 2014 14:02:08 GMT
Expires: Sun, 23 Mar 2014 14:02:52 GMT
Last-Modified: Sun, 23 Mar 2014 14:01:52 GMT

In this page, core/elementary.git is shown as last modified '58 min.'
ago.

$ curl -s https://git.enlightenment.org/ \
  | sed -e 's;<html xmlns=.*>;<html>;' \
	| xmlstarlet fo -o -D -R --html 2> /dev/null \
	| xmlstarlet sel -T -t \
      -m "html/body/div/div/table/tr/td/a[@title='core/elementary.git']" \
			-v "../..//span[@class='age-mins']" -n
58 min.

* Repo page

$ curl -sD - -o /dev/null https://git.enlightenment.org/core/elementary.git/ \
  | grep -E '^(Date|Expires|Last-Modified): '
Date: Sun, 23 Mar 2014 14:02:14 GMT
Expires: Mon, 10 Mar 2014 20:49:55 GMT
Last-Modified: Mon, 10 Mar 2014 20:48:55 GMT

As you see, the Expires header is wrong as the configuration state it
should not be older than 1 minute (cache-repo-ttl).

Here, master is the last modified branch and is shown as last modified
'3 hours' ago.

$ curl -s https://git.enlightenment.org/core/elementary.git/ \
  | sed -e 's;<html xmlns=.*>;<html>;' \
	| xmlstarlet fo -o -D -R --html 2> /dev/null \
	| xmlstarlet sel -T -t \
      -m "html/body/div/div/table/tr/td/a[@href='/core/elementary.git/log/']" \
      -v "../..//span[@class='age-hours']" -n
3 hours

* All branch page

$ curl -sD - -o /dev/null https://git.enlightenment.org/core/elementary.git/refs/heads \
  | grep -E '^(Date|Expires|Last-Modified): '
Date: Sun, 23 Mar 2014 14:02:22 GMT
Expires: Sun, 23 Mar 2014 14:03:22 GMT
Last-Modified: Sun, 23 Mar 2014 14:02:22 GMT

In this page, the master is showned as last modified '61 min.' ago.

$ curl -s https://git.enlightenment.org/core/elementary.git/refs/heads \
  | sed -e 's;<html xmlns=.*>;<html>;' \
	| xmlstarlet fo -o -D -R --html 2> /dev/null \
	| xmlstarlet sel -t \
      -m "html/body/div/div/table/tr/td/a[@href='/core/elementary.git/log/']" \
      -v "../..//span[@class='age-mins']" -n
61 min.

How can we fix this ? I have some .lock files in the cache directory, is
there any way to flush the lock files after some period ? Also, to help
debugging this, it should be nice to have a X-Cgit-Cache: header
containing the cache file used given to user.

Once I remove '*.lock' in cache directory, 'Repo page' and 'All branch
page' are equal, but 'Main page' is not OK (ordered in the same as
before) :

62 min.
65 min.
65 min.

-- 
Beber


             reply	other threads:[~2014-03-23 14:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-23 14:06 beber [this message]
2015-02-28 12:06 ` bertrand
2015-02-28 12:37   ` john
2015-03-01 18:43     ` bertrand
2015-03-01 19:36       ` john
2015-03-03  9:31         ` john
2015-03-03 15:40           ` Jason
2015-03-03 19:22             ` john
2015-03-03 22:56               ` Jason
2015-03-03 23:43                 ` john

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140323140642.GF1223@lemonhead.scabb \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).