118: def expire_fragment_with_locale(name, options = nil)
119: return unless perform_caching
120:
121: fc_store = (respond_to? :cache_store) ? cache_store : fragment_cache_store
122: key = name.is_a?(Regexp) ? name : fragment_cache_key_without_locale(name)
123: if key.is_a?(Regexp)
124: self.class.benchmark "Expired fragments matching: #{key.source}" do
125: fc_store.delete_matched(key, options)
126: end
127: else
128: key = key.gsub(/:/, ".")
129: self.class.benchmark "Expired fragment: #{key}, lang = #{I18n.supported_locales}" do
130: supported_locales.each do |lang|
131: fc_store.delete("#{key}_#{lang}", options)
132: end
133: end
134: end
135: end