Sha256: 7443df4906e28447b258b74e41622865031bd571c38fd2b6ec6e98a6bc4b966c

Contents?: true

Size: 590 Bytes

Versions: 9

Compression:

Stored size: 590 Bytes

Contents

class Admin::CacheController < Admin::BaseController

  def index
    list
    render_action 'list'
  end

  def list
    @page_cache_size = PageCache.count
  end

  def sweep
    PageCache.sweep_all
    expire_fragment(/.*/)

    flash[:notice] = 'Cache was cleared'
    redirect_to :controller => 'general'
  end

  def sweep_html
    Article.transaction do
      Article.update_all 'body_html = null'
      Comment.update_all 'body_html = null'
      Page.update_all 'body_html = null'
    end

    flash[:notice] = 'HTML was cleared'
    redirect_to :controller => 'general'
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
typo-3.99.0 app/controllers/admin/cache_controller.rb
typo-3.99.2 app/controllers/admin/cache_controller.rb
typo-3.99.1 app/controllers/admin/cache_controller.rb
typo-3.99.3 app/controllers/admin/cache_controller.rb
typo-4.0.2 app/controllers/admin/cache_controller.rb
typo-3.99.4 app/controllers/admin/cache_controller.rb
typo-4.0.0 app/controllers/admin/cache_controller.rb
typo-4.0.1 app/controllers/admin/cache_controller.rb
typo-4.0.3 app/controllers/admin/cache_controller.rb