Skip to content

Commit ca59056

Browse files
committed
Fix HTTP caching for assets
1 parent edd5195 commit ca59056

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/yard/server/commands/base.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def not_found
183183
self.body = "Not found: #{request.path}"
184184
headers['Content-Type'] = 'text/plain'
185185
headers['X-Cascade'] = 'pass'
186-
headers.delete('Cache-Control')
186+
headers['Cache-Control'] = 'nocache'
187187
end
188188

189189
# Sets the headers and status code for a redirection to a given URL
@@ -201,7 +201,7 @@ def redirect(url)
201201
# requests served with "?1234567890" style timestamp query strings.
202202
def add_cache_control
203203
return if request.query_string.to_i == 0
204-
headers['Cache-Control'] = 'private, max-age=300'
204+
headers['Cache-Control'] ||= 'public, max-age=300'
205205
end
206206
end
207207
end

0 commit comments

Comments
 (0)