Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c928b6c

Browse filesBrowse files
Added caching headers
1 parent ca82685 commit c928b6c
Copy full SHA for c928b6c

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed

‎app.rb

Copy file name to clipboardExpand all lines: app.rb
+4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.