gist: 2095 Download_button fork
public
Public Clone URL: git://gist.github.com/2095.git
using_last_modified_caching_in_sinatra.rb
1
2
3
4
5
6
7
8
get '/:post_id' do
  last_modification_of_post = Blog::Post[ params[:post_id], {:only => ['id', 'updated_on']} ]
  last_modified( last_modification_of_post.updated_on ) if last_modification_of_post
  @post = Blog::Post[ params[:post_id] ]
  throw :halt, [404, erb(not_found) ] unless @post
  erb :post
end

Owner

karmi

Revisions