diff options
author | Marius Mathiesen <marius.mathiesen@gmail.com> | 2009-02-23 12:11:41 +0100 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2009-04-22 15:14:46 +0200 |
commit | ab19688f69a8108df4f17d7e9bee664179c9507f (patch) | |
tree | aca7551a27c8c847006d4131ce3569a7cdbaec90 /app/controllers/blobs_controller.rb | |
parent | 302a0db47ace66d0d0d06007f0251bdd5c27c31c (diff) | |
download | gitorious-mainline-outdated-ab19688f69a8108df4f17d7e9bee664179c9507f.zip gitorious-mainline-outdated-ab19688f69a8108df4f17d7e9bee664179c9507f.tar.gz gitorious-mainline-outdated-ab19688f69a8108df4f17d7e9bee664179c9507f.tar.bz2 |
Adding cache control to Blobs#show and Blobs#raw
Diffstat (limited to 'app/controllers/blobs_controller.rb')
-rw-r--r-- | app/controllers/blobs_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/blobs_controller.rb b/app/controllers/blobs_controller.rb index edd7126..46d85ae 100644 --- a/app/controllers/blobs_controller.rb +++ b/app/controllers/blobs_controller.rb @@ -35,6 +35,7 @@ class BlobsController < ApplicationController unless @blob.respond_to?(:data) # it's a tree redirect_to project_repository_tree_path(@project, @repository, @commit.id, @path) end + cache_for 2.minutes end def raw @@ -51,6 +52,7 @@ class BlobsController < ApplicationController flash[:error] = I18n.t "blogs_controller.raw_error" redirect_to project_repository_path(@project, @repository) and return end + cache_for 2.minutes render :text => @blob.data, :content_type => @blob.mime_type end |