Commit ee330f5f

mo khan <mo@mokhan.ca>
2014-01-01 05:31:47
remove etags... they are annoying and hard to control.
1 parent 8407ed7
app/controllers/admin/users_controller.rb
@@ -5,7 +5,6 @@ module Admin
       @recent_users = @users.limit(10)
       @active_users = @users.order(:updated_at).limit(10)
       expires_in(10.minutes)
-      fresh_when(User.maximum(:updated_at)) if User.any?
     end
   end
 end
app/controllers/creation_tags_controller.rb
@@ -2,7 +2,6 @@ class CreationTagsController < ApplicationController
   def index
     @tags = Creation.tag_counts_on(:tags)
     expires_in(6.hours)
-    fresh_when(@tags) if @tags.any?
   end
 
   def show
@@ -11,6 +10,5 @@ class CreationTagsController < ApplicationController
     @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(@creations)
   end
 end
app/controllers/profiles_controller.rb
@@ -4,7 +4,6 @@ class ProfilesController < ApplicationController
   def index
     @profiles = User.includes(:avatar).where('creations_count > 0').order(:creations_count => :desc).page(params[:page]).per(12)
     expires_in(1.hour)
-    fresh_when(User.maximum(:updated_at)) if User.any?
   end
 
   def show
@@ -16,7 +15,6 @@ class ProfilesController < ApplicationController
       @map_url += "&markers=#{user.latitude}%2C#{user.longitude}"
     end
     expires_in(1.hour)
-    fresh_when(@user)
   end
 
   def favorites
app/controllers/sitemap_controller.rb
@@ -7,7 +7,6 @@ class SitemapController < ApplicationController
     @base_url = "https://#{request.host_with_port}"
     headers['Content-Type'] = 'application/xml'
     expires_in(1.hour)
-    fresh_when(@creations) if @creations.any?
     respond_to do |format|
       format.xml
     end
app/controllers/tutorial_tags_controller.rb
@@ -2,7 +2,6 @@ class TutorialTagsController < ApplicationController
   def index
     @tags = Tutorial.tag_counts_on(:tags)
     expires_in(6.hours)
-    fresh_when(@tags) if @tags.any?
   end
 
   def show
@@ -11,6 +10,5 @@ class TutorialTagsController < ApplicationController
     @total_creations = Creation.tagged_with(@tag).count
     @tutorials = Tutorial.includes(:tags).tagged_with(@tag).page(params[:page]).per(15)
     expires_in(6.hours)
-    fresh_when(@tutorials)
   end
 end
app/controllers/tutorials_controller.rb
@@ -4,13 +4,11 @@ class TutorialsController < ApplicationController
   def index
     @tutorials = Tutorial.includes(:tags).page(params[:page]).per(15)
     expires_in(10.minutes)
-    fresh_when(Tutorial.maximum(:updated_at)) if Tutorial.any?
   end
 
   def show
     @tutorial = Tutorial.find(params[:id])
     expires_in(24.hours)
-    fresh_when(@tutorial)
   end
 
   def new