Skip to content

Commit c928b6c

Browse files
Added caching headers
1 parent ca82685 commit c928b6c

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy