Introduce Repository.cached_paginated_commits for speedier display of commit logs
authorJohan Sørensen <johan@johansorensen.com>
Wed, 11 Feb 2009 16:27:44 +0000 (17:27 +0100)
committerJohan Sørensen <johan@johansorensen.com>
Wed, 22 Apr 2009 12:05:18 +0000 (14:05 +0200)
commit216086d04ad15ba36175f06251e243928eb353d5
tree28794d210ec2f5905fb2e4c129b46f50f858a29a
parent6131db4aff7e8b93ee902b302a7092c4a9afb45f
Introduce Repository.cached_paginated_commits for speedier display of commit logs

It caches two items:
1) the total commit count
2) the entries on a given page

Both cache keys include the SHA of the last commit, making it expire if there's
a new commit. Reason for the two cache keys are that we can then reuse the commit
count when the user goes to a new page (as long as there's no new commit)
app/controllers/commits_controller.rb
app/helpers/trees_helper.rb
app/models/repository.rb
config/environments/development.rb
spec/controllers/commits_controller_spec.rb
spec/helpers/trees_helper_spec.rb
spec/models/repository_spec.rb
spec/spec_helper.rb