Skip to content

Commit a62248c

Browse files
committed
Add expiry to YARD pages
1 parent e68d8ac commit a62248c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/controllers/concerns/cacheable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ module Cacheable
88
private
99

1010
def set_cache_headers
11-
expires_in 1.hour, public: true
11+
expires_in 1.day, public: true
1212
end
1313
end

app/controllers/yard_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def respond
6262
if status == 404
6363
render "errors/library_not_found", status: 404, layout: "application"
6464
return
65+
elsif status == 200
66+
expires_in 1.day, public: true
6567
end
6668

6769
Rails.cache.delete(cache_key) if library_version&.ready? && (status != 200 || body.first.blank?)

0 commit comments

Comments
 (0)