Add cache control headers
This commit is contained in:
parent
894aa08629
commit
c47a222c83
@ -8,6 +8,7 @@ class CPIFeed < Sinatra::Base
|
|||||||
get '/' do
|
get '/' do
|
||||||
resp = JSON.parse(Faraday.get(cpi_series_url).body)
|
resp = JSON.parse(Faraday.get(cpi_series_url).body)
|
||||||
|
|
||||||
|
expires 300, :public, :must_revalidate
|
||||||
content_type :csv
|
content_type :csv
|
||||||
"cpi\n#{resp['Results']['series'].first['data'].first['value']}\n"
|
"cpi\n#{resp['Results']['series'].first['data'].first['value']}\n"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user