class ActiveSupport::Cache::FileStore
def normalize_key(key, options)
def normalize_key(key, options) key = super fname = URI.encode_www_form_component(key) if fname.size > FILEPATH_MAX_SIZE fname = ActiveSupport::Digest.hexdigest(key) end hash = Zlib.adler32(fname) hash, dir_1 = hash.divmod(0x1000) dir_2 = hash.modulo(0x1000) # Make sure file name doesn't exceed file system limits. if fname.length < FILENAME_MAX_SIZE fname_paths = fname else fname_paths = [] begin fname_paths << fname[0, FILENAME_MAX_SIZE] fname = fname[FILENAME_MAX_SIZE..-1] end until fname.blank? end File.join(cache_path, DIR_FORMATTER % dir_1, DIR_FORMATTER % dir_2, fname_paths) end