lib/yard/server/commands/base.rb in yard-0.9.25 vs lib/yard/server/commands/base.rb in yard-0.9.26
- old
+ new
@@ -181,11 +181,11 @@
self.status = 404
return unless body.empty?
self.body = "Not found: #{request.path}"
headers['Content-Type'] = 'text/plain'
headers['X-Cascade'] = 'pass'
- headers.delete('Cache-Control')
+ headers['Cache-Control'] = 'nocache'
end
# Sets the headers and status code for a redirection to a given URL
# @param [String] url the URL to redirect to
# @raise [FinishRequest] causes the request to terminate.
@@ -199,10 +199,10 @@
# Add a conservative cache control policy to reduce load on
# requests served with "?1234567890" style timestamp query strings.
def add_cache_control
return if request.query_string.to_i == 0
- headers['Cache-Control'] = 'private, max-age=300'
+ headers['Cache-Control'] ||= 'public, max-age=300'
end
end
end
end
end