Commit a58d67be

mo khan <mo@mokhan.ca>
2013-12-29 02:05:10
add cache control headers and etag too creation tags /t and /t/fondant.
1 parent 09f0f93
Changed files (1)
app/controllers/creation_tags_controller.rb
@@ -1,6 +1,8 @@
 class CreationTagsController < ApplicationController
   def index
     @tags = Creation.tag_counts_on(:tags)
+    expires_in(6.hours)
+    fresh_when(@tags) if @tags.any?
   end
 
   def show
@@ -8,5 +10,7 @@ class CreationTagsController < ApplicationController
     @total_tutorials = Tutorial.tagged_with(@tag).count
     @total_creations = Creation.tagged_with(@tag).count
     @creations = Creation.includes([:user, :tags, :photos]).tagged_with([@tag]).where('photos_count > 0').page(params[:page]).per(15)
+    expires_in(6.hours)
+    fresh_when(@tag)
   end
 end