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 =
'0.19.0'.freeze

Class Method Summary collapse

Class Method Details

.disk_cache?Boolean

Returns:

  • (Boolean)


126
127
128
# File 'lib/seo_cache.rb', line 126

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

.log(message) ⇒ Object



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

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

.log_error(message) ⇒ Object



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

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

.loggerObject



130
131
132
# File 'lib/seo_cache.rb', line 130

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

.memory_cache?Boolean

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

Returns:

  • (Boolean)


122
123
124
# File 'lib/seo_cache.rb', line 122

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