Commit 0969fb8a

mo khan <mo@mokhan.ca>
2013-12-29 01:44:28
set cache control and etag headers for /creations.
1 parent fc61111
Changed files (1)
app/controllers/creations_controller.rb
@@ -3,11 +3,15 @@ class CreationsController < ApplicationController
 
   def index
     @creations = FindAllCreationsQuery.new.fetch(params)
+    expires_in(10.minutes)
+    fresh_when(Creation.maximum(:updated_at)) if Creation.any?
   end
 
   def show
     @creation = Creation.find(params[:id])
     @primary_photo = @creation.primary_image
+    expires_in(1.minute)
+    fresh_when(@creation)
   end
 
   def new