Reativando o cache nas folhas de estilo
This commit is contained in:
@@ -17,7 +17,7 @@ class AttachmentsController < ApplicationController
|
||||
# :redirect_to => { :controller => 'courses', :action => :show }
|
||||
|
||||
before_filter :find_attachment, :except => [ :undelete ]
|
||||
after_filter :cache_sweep, :only => [ :create, :update, :destroy ]
|
||||
#after_filter :cache_sweep, :only => [ :create, :update, :destroy ]
|
||||
|
||||
def show
|
||||
end
|
||||
@@ -100,6 +100,6 @@ class AttachmentsController < ApplicationController
|
||||
end
|
||||
|
||||
def cache_sweep
|
||||
expire_fragment(:controller => 'courses', :action => 'show')
|
||||
expire_fragment(course_path(@course.id))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,12 +16,10 @@ class CoursesController < ApplicationController
|
||||
before_filter :require_admin, :only => [ :new, :create, :edit, :update, :destroy ]
|
||||
before_filter :require_login, :only => [ :enroll, :unenroll ]
|
||||
before_filter :find_course, :except => [ :index ]
|
||||
after_filter :cache_sweep, :only => [ :create, :update, :destroy ]
|
||||
#after_filter :cache_sweep, :only => [ :create, :update, :destroy ]
|
||||
|
||||
def index
|
||||
@courses = Course.find(:all,
|
||||
:order => 'period asc, full_name asc',
|
||||
:conditions => (logged_in? and !@current_user.courses.empty? ? [ 'id not in (?)', @current_user.courses] : ''))
|
||||
@courses = Course.find(:all, :order => 'period asc, full_name asc')
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
@@ -104,9 +102,8 @@ class CoursesController < ApplicationController
|
||||
end
|
||||
|
||||
def cache_sweep
|
||||
expire_fragment(:action => 'show', :part => 'right')
|
||||
expire_fragment(:action => 'show', :part => 'left')
|
||||
expire_fragment(:action => 'show')
|
||||
expire_fragment(:action => 'index')
|
||||
expire_fragment(course_path(@course.id, :part => 'right'))
|
||||
expire_fragment(course_path(@course.id))
|
||||
expire_fragment(courses_path)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class EventsController < ApplicationController
|
||||
|
||||
before_filter :find_event, :except => [ :mini_calendar, :undelete ]
|
||||
after_filter :cache_sweep, :only => [ :create, :update, :destroy ]
|
||||
#after_filter :cache_sweep, :only => [ :create, :update, :destroy ]
|
||||
|
||||
def index
|
||||
@events = @course.events
|
||||
@@ -113,7 +113,7 @@ class EventsController < ApplicationController
|
||||
end
|
||||
|
||||
def cache_sweep
|
||||
expire_fragment(:controller => 'courses', :action => 'show', :part => 'right')
|
||||
expire_fragment(:action => 'index')
|
||||
expire_fragment(course_path(@course.id, :part => 'right'))
|
||||
expire_fragment(course_events_path(@course.id))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@ class NewsController < ApplicationController
|
||||
# :redirect_to => { :action => :list }
|
||||
|
||||
before_filter :find_new, :except => [ :undelete ]
|
||||
after_filter :cache_sweep, :only => [ :create, :update, :destroy ]
|
||||
#after_filter :cache_sweep, :only => [ :create, :update, :destroy ]
|
||||
|
||||
def index
|
||||
@news = @course.news
|
||||
@@ -105,7 +105,7 @@ class NewsController < ApplicationController
|
||||
end
|
||||
|
||||
def cache_sweep
|
||||
expire_fragment(:controller => 'courses', :action => 'show', :part => 'right')
|
||||
expire_fragment(:action => 'index')
|
||||
expire_fragment(course_path(@course.id, :part => :right))
|
||||
expire_fragment(course_news_index_path(@course.id))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class StylesheetsController < ApplicationController
|
||||
|
||||
layout nil
|
||||
caches_page :wiki
|
||||
caches_page :wiki, :color
|
||||
before_filter :set_headers
|
||||
|
||||
private
|
||||
|
||||
@@ -111,7 +111,7 @@ class UsersController < ApplicationController
|
||||
@events = []
|
||||
|
||||
if params[:format] == 'html'
|
||||
return unless require_login
|
||||
return require_login unless logged_in?
|
||||
@user = @current_user
|
||||
else
|
||||
@user = User.find_by_secret(params[:secret])
|
||||
@@ -119,7 +119,7 @@ class UsersController < ApplicationController
|
||||
|
||||
unless @user.courses.empty?
|
||||
@news = News.find(:all, :conditions => [ 'receiver_id in (?)', @user.courses ],
|
||||
:order => 'timestamp desc', :limit => 5)
|
||||
:order => 'timestamp desc', :limit => 20)
|
||||
@events = Event.find(:all, :conditions => [ 'course_id in (?) and (time > ?) and (time < ?)',
|
||||
@user.courses, 1.day.ago, 21.days.from_now ], :order => 'time')
|
||||
end
|
||||
|
||||
@@ -16,7 +16,9 @@ class WikiController < ApplicationController
|
||||
verify :params => :text, :only => :preview, :redirect_to => { :action => :show }
|
||||
verify :params => [:from, :to], :only => :diff, :redirect_to => { :action => :versions }
|
||||
|
||||
after_filter :cache_sweep, :only => [ :create, :update, :destroy ]
|
||||
#after_filter :cache_sweep, :only => [ :create, :update, :destroy, :move_up,
|
||||
# :move_down, :undelete ]
|
||||
|
||||
before_filter :find_wiki, :except => [ :preview, :undelete ]
|
||||
before_filter :require_login, :only => [ :new, :create, :edit, :update, :destroy,
|
||||
:move_up, :move_down, :undelete ]
|
||||
@@ -158,7 +160,7 @@ class WikiController < ApplicationController
|
||||
end
|
||||
|
||||
def cache_sweep
|
||||
expire_fragment(:controller => 'courses', :action => 'show')
|
||||
expire_fragment(:action => 'show')
|
||||
expire_fragment course_path(@course.id)
|
||||
expire_fragment course_wiki_path(@course.id, @wiki_page.id)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user