This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/cache_tag_invalidation.rb | |
module CacheTagInvalidation | |
puts <<-WARNING | |
Adding cache tag invalidation. | |
NOTICE that this will work only with MemoryStore on single process or with memcached store | |
WARNING | |
def write *args | |
if args.first.is_a?(Array) && args.first.size == 2 # Simulate tags only whan cache key is an array of 2 elements | |
key, tag = args.first | |
taglist_key = ["CacheTagList", tag] |