lib/scrivito/cms_backend.rb in scrivito_sdk-0.40.0 vs lib/scrivito/cms_backend.rb in scrivito_sdk-0.41.0.rc1
- old
+ new
@@ -62,11 +62,11 @@
def begin_caching
@caching = true
end
def end_caching
- CmsCacheStorage.cache.clear
+ CmsDataCache.cache.clear
@caching = false
end
def caching?
!!@caching
@@ -190,11 +190,11 @@
def store_search_result_in_cache(content_state, cache_index, cache_key, result)
content_state.save_obj_data(cache_index, cache_key, result) if caching?
end
def fetch_blob_data_from_cache(id, access, verb)
- CmsCacheStorage.cache.read(blob_data_cache_key(id, access, verb))
+ CmsDataCache.cache.read(blob_data_cache_key(id, access, verb))
end
def request_blob_datas_from_backend(id)
@query_counter += 1
CmsRestApi.get("blobs/#{id}")
@@ -202,22 +202,22 @@
def store_blob_datas_in_cache(id, blob_datas)
%w[public_access private_access].each do |access|
%w[get head].each do |verb|
blob_data = blob_datas[access][verb]
- CmsCacheStorage.cache.write(blob_data_cache_key(id, access, verb),
+ CmsDataCache.cache.write(blob_data_cache_key(id, access, verb),
blob_data, expires_in: blob_data['maxage'])
end
end
end
def blob_data_cache_key(id, access, verb)
"blob_data/#{id}/#{access}/#{verb}"
end
def fetch_blob_metadata_from_cache(id)
- CmsCacheStorage.cache.read(blob_metadata_cache_key(id))
+ CmsDataCache.cache.read(blob_metadata_cache_key(id))
end
def request_blob_metadata_from_s3(url)
uri = URI.parse(url)
retried = false
@@ -240,10 +240,10 @@
end
def store_blob_metadata_in_cache(id, blob_metadata)
max_age = blob_metadata.delete(:cache_control) =~ /max-age=(.*),/ && $1
max_age = max_age.to_i if max_age
- CmsCacheStorage.cache.write(blob_metadata_cache_key(id), blob_metadata, expires_in: max_age)
+ CmsDataCache.cache.write(blob_metadata_cache_key(id), blob_metadata, expires_in: max_age)
end
def blob_metadata_cache_key(id)
"blob_metadata/#{id}"
end