Files
danbooru/app/controllers/robots_controller.rb
evazion 4b61a9c73c /robots.txt: enable HTTP caching.
Cache /robots.txt at the HTTP level because it rarely changes but it
gets requested by bots relatively frequently.
2021-03-07 18:35:37 -06:00

8 lines
164 B
Ruby

class RobotsController < ApplicationController
respond_to :text
def index
expires_in 1.hour, public: true unless response.cache_control.present?
end
end