Caching: MVP stage
Working implementation with three levels of organization per cache. Cache -> Partition -> File. Current non blocking lock for the intermediate file generation needs to be replaced to a blocking lock. Needs tests. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -234,7 +234,8 @@ class APIDocumentPageImageView(generics.RetrieveAPIView):
|
||||
)
|
||||
|
||||
cache_filename = task.get(timeout=DOCUMENT_IMAGE_TASK_TIMEOUT)
|
||||
with storage_documentimagecache.open(cache_filename) as file_object:
|
||||
#with storage_documentimagecache.open(cache_filename) as file_object:
|
||||
with self.get_object().cache_partition.get_file(filename=cache_filename).open() as file_object:
|
||||
response = HttpResponse(file_object.read(), content_type='image')
|
||||
if '_hash' in request.GET:
|
||||
patch_cache_control(
|
||||
|
||||
Reference in New Issue
Block a user