summaryrefslogtreecommitdiff
path: root/ironic/common/image_service.py
diff options
context:
space:
mode:
Diffstat (limited to 'ironic/common/image_service.py')
-rw-r--r--ironic/common/image_service.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ironic/common/image_service.py b/ironic/common/image_service.py
index 615e8f63e..e878f8e63 100644
--- a/ironic/common/image_service.py
+++ b/ironic/common/image_service.py
@@ -183,10 +183,13 @@ class HttpImageService(BaseImageService):
except ValueError:
continue
+ no_cache = 'no-store' in response.headers.get('Cache-Control', '')
+
return {
'size': int(image_size),
'updated_at': date,
- 'properties': {}
+ 'properties': {},
+ 'no_cache': no_cache,
}
@@ -259,7 +262,9 @@ class FileImageService(BaseImageService):
'size': os.path.getsize(source_image_path),
'updated_at': utils.unix_file_modification_datetime(
source_image_path),
- 'properties': {}
+ 'properties': {},
+ # No point in caching local file images
+ 'no_cache': True,
}