# File lib/dragonfly/response.rb, line 15
    def to_response
      if !(request.head? || request.get?)
        [405, method_not_allowed_headers, ["#{request.request_method} method not allowed"]]
      elsif etag_matches?
        [304, cache_headers, []]
      elsif request.head?
        job.apply
        env['dragonfly.job'] = job
        [200, success_headers, []]
      elsif request.get?
        job.apply
        env['dragonfly.job'] = job
        [200, success_headers, job]
      end
    rescue DataStorage::DataNotFound, DataStorage::BadUID => e
      app.log.warn(e.message)
      [404, {"Content-Type" => 'text/plain'}, ['Not found']]
    end