Module: SeoCache

Defined in:
lib/seo_cache.rb,
lib/seo_cache/logger.rb,
lib/seo_cache/version.rb,
lib/seo_cache/middleware.rb,
lib/seo_cache/page_render.rb,
lib/seo_cache/page_caching.rb,
lib/seo_cache/populate_cache.rb

Defined Under Namespace

Classes: Logger, Middleware, PageCaching, PageRender, PopulateCache

Constant Summary collapse

VERSION =
'1.2.1'.freeze

Class Method Summary collapse

Class Method Details

.disk_cache?Boolean

Returns:

  • (Boolean)


132
133
134
# File 'lib/seo_cache.rb', line 132

def self.disk_cache?
  SeoCache.cache_mode == 'disk'
end

.log(message) ⇒ Object



140
141
142
143
# File 'lib/seo_cache.rb', line 140

def self.log(message)
  SeoCache.logger.info(message)
  # Rails.logger.info { "[seo_cache] #{message}" }
end

.log_error(message) ⇒ Object



145
146
147
148
# File 'lib/seo_cache.rb', line 145

def self.log_error(message)
  SeoCache.logger.error(message)
  # Rails.logger.error { "[seo_cache] #{message}" }
end

.loggerObject



136
137
138
# File 'lib/seo_cache.rb', line 136

def self.logger
  @logger ||= SeoCache::Logger.new(SeoCache.logger_path)
end

.memory_cache?Boolean

self.logger = SeoCache::Logger.new(SeoCache.logger_path)

Returns:

  • (Boolean)


128
129
130
# File 'lib/seo_cache.rb', line 128

def self.memory_cache?
  SeoCache.cache_mode == 'memory'
end