Skip to content

Commit

Permalink
Enabled client-side caching in the IIIF service.
Browse files Browse the repository at this point in the history
Arbitrary value of 1 hour allows web browsers to close and re-open overlay viewers without requesting image tiles every time.  

Complements providence/pull/1612
  • Loading branch information
miqrogroove authored Sep 4, 2024
1 parent 0ae3dda commit e43c1d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/lib/Service/IIIFService.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class IIIFService {
* @throws Exception
*/
public static function dispatch(string $identifier, RequestHTTP $request, ResponseHTTP $response) {
$response->addHeader('Cache-Control', 'max-age=3600, private', true); // Cache all responses for 1 hour.

$va_path = array_filter(array_slice(explode("/", $request->getPathInfo()), 3), 'strlen');
$vs_key = $identifier."/".join("/", $va_path);

Expand Down

0 comments on commit e43c1d5

Please sign in to comment.