|
|
@ -191,6 +191,7 @@ function islandora_view_datastream_cache_check(AbstractDatastream $datastream) { |
|
|
|
* The datastream being viewed/downloaded. |
|
|
|
* The datastream being viewed/downloaded. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_view_datastream_set_cache_headers(AbstractDatastream $datastream) { |
|
|
|
function islandora_view_datastream_set_cache_headers(AbstractDatastream $datastream) { |
|
|
|
|
|
|
|
if (variable_get('islandora_use_datastream_cache_headers', TRUE)) { |
|
|
|
// Force cache revalidation. |
|
|
|
// Force cache revalidation. |
|
|
|
header('Expires: Sun, 19 Nov 1978 05:00:00 GMT'); |
|
|
|
header('Expires: Sun, 19 Nov 1978 05:00:00 GMT'); |
|
|
|
$cache_control = array(); |
|
|
|
$cache_control = array(); |
|
|
@ -208,6 +209,11 @@ function islandora_view_datastream_set_cache_headers(AbstractDatastream $datastr |
|
|
|
header("Etag: \"{$datastream->checksum}\""); |
|
|
|
header("Etag: \"{$datastream->checksum}\""); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
header_remove('Cache-Control'); |
|
|
|
|
|
|
|
header_remove('Expires'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get the human readable size of the given datastream. |
|
|
|
* Get the human readable size of the given datastream. |
|
|
|