improve caching logic
This commit is contained in:
parent
ca47b31904
commit
778acbf275
|
@ -14,10 +14,11 @@ module Travis::Api::App::Responders
|
||||||
private
|
private
|
||||||
|
|
||||||
def cache_control
|
def cache_control
|
||||||
return unless final? # FIXME
|
if final?
|
||||||
mode = [endpoint.public? ? :public : :private]
|
mode = endpoint.public? ? :public : :private
|
||||||
mode << :must_revalidate #unless final?
|
endpoint.expires(31536000, mode, :must_revalidate) # 1 year
|
||||||
endpoint.expires(31536000, *mode) # 1 year
|
end
|
||||||
|
|
||||||
endpoint.etag resource.cache_key if cache_key?
|
endpoint.etag resource.cache_key if cache_key?
|
||||||
endpoint.last_modified resource.updated_at if updated_at?
|
endpoint.last_modified resource.updated_at if updated_at?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user