Skip to content

Instantly share code, notes, and snippets.

@ecpplus
Created December 13, 2011 04:08
Show Gist options
  • Save ecpplus/1470536 to your computer and use it in GitHub Desktop.
Save ecpplus/1470536 to your computer and use it in GitHub Desktop.
Rails の send_data で Expires ヘッダを付与
response.headers["Expires"] = CGI.rfc1123_date(Time.now + period)
send_data some_png_binary,
:filename => 'image.png',
:type => 'image/png'
# http://stackoverflow.com/questions/3117361/how-do-i-set-expires-header-when-using-send-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment