Aqila::Cache
Invalidate the cache when the model data changes.
Publish
make release
Guide
Initializer:
Aqila::Cache.configure do |config|
config.configure_model do |model|
model.table_name = :ino_log_table
model.sequence_name = :gen_ino_log_table
end
config.default_ttl = 1.day
end
Example Model:
class Estadio < ActiveRecord::Base
include Aqila::Cache::Callbacks
self.cache_ttl = 1.day
...
end
Example Controller:
class V1::EstadiosController < ApplicationController
def index
return unless Estadio.stale?(controller: self)
...