Skip to content

Commit 6a2b459

Browse files
committed
Merge branch 'Michael-F-Bryan-caching'
2 parents ca82685 + c928b6c commit 6a2b459

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
get '/:username' do
1616
#default color scheme used by github
1717
headers 'Content-Type' => "image/svg+xml"
18+
headers 'Cache-Control' => "max-age=#{60*60*24}"
19+
1820
username = params[:username].chomp('.svg') #Chomp off the .svg extension to be backwards compatible
1921
svg = GithubChart.new(user: username).svg
2022
stream do |out|
@@ -23,7 +25,9 @@
2325
end
2426

2527
get '/:base/:username' do
28+
headers 'Cache-Control' => "max-age=#{60*60*24}"
2629
headers 'Content-Type' => "image/svg+xml"
30+
2731
username = params[:username].chomp('.svg')
2832

2933
#Makes API backwards compatible

0 commit comments

Comments
 (0)