reimplement caching of robots.txt

pull/4862/head
Jens Ulferts 8 years ago
parent e6c4b12c58
commit fa37edd2dd
No known key found for this signature in database
GPG Key ID: 3CAA4B1182CF5308
  1. 2
      app/controllers/homescreen_controller.rb
  2. 6
      app/views/homescreen/robots.text.erb

@ -28,7 +28,6 @@
#++
class HomescreenController < ApplicationController
skip_before_filter :check_if_login_required, only: [:robots]
def index
@ -43,5 +42,4 @@ class HomescreenController < ApplicationController
def robots
@projects = Project.active.public_projects
end
caches_action :robots
end

@ -27,10 +27,12 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
User-agent: *
<% @projects.each do |p| -%>
<% cache @projects.cache_key(:updated_on) do %>
<% @projects.each do |p| -%>
Disallow: <%= project_repository_path(p) %>
Disallow: <%= project_work_packages_path(p) %>
Disallow: <%= project_activity_index_path(p) %>
<% end -%>
<% end -%>
<% end %>
Disallow: /work_packages/calendar
Disallow: /activity

Loading…
Cancel
Save