How to configure Expires HTTP header for served digital object representations

28 views
Skip to first unread message

Orestes Sanchez

unread,
May 28, 2025, 1:20:57 PM5/28/25
to AtoM Users
Hi,

Our AtoM server (version 2.8.2) is serving digital object representations.
The point is that they are served with an HTTP Expires header in the past (on year 1981) :( so images are never cached.

We have not found any point on the AtoM documentation nor in our setup (nginx conf files, etc.) that configures the expiration.

Will you advice on how to deal with it?

You can check it here:

Here it is a dump of the headers for an digital object derivative from that page:
accept-ranges
bytes
cache-control
no-store, no-cache, must-revalidate
content-length
15292
content-type
image/jpeg
date
Wed, 28 May 2025 17:14:19 GMT
etag
"683095bf-3bbc"
expires
Thu, 19 Nov 1981 08:52:00 GMT
last-modified
Fri, 23 May 2025 15:35:27 GMT
server
nginx/1.28.0
set-cookie
atom_culture=ca; path=/; secure; HttpOnly; SameSite=strict
set-cookie
atom_authenticated=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; SameSite=strict

I tried to figure out any relationship between the Last-Modified date and the Expires date, but I didn't find any.
Here there are the dates converted to Epoch seconds since 1970:
Date and time (GMT): Friday, May 23, 2025 15:35:27, Epoch timestamp:1748014527


Date and time (GMT): Thursday, November 19, 1981 8:52:00, Epoch timestamp: 375007920

Orestes Sanchez

unread,
May 28, 2025, 1:43:08 PM5/28/25
to AtoM Users
I think I managed to solve it myself ;)

I initially thought the wrong Expires header was the result of any AtoM configuration, and I didn't try to set it up explicitly on nginx.

I finally give it a try with an explicit Expires header on nginx configuration, and now it works! I had to modify the `private` location entry this way:

    location ~ ^/private/(.*)$ {
        internal;
     expires 30d;
     add_header Pragma public;
     add_header Cache-Control "public";
        ##############################################
        #
        # Set this up for your AtoM root path
        #
        alias PATH_TO_YOUR_DOCUMENT_ROOT/$1;
    }
Reply all
Reply to author
Forward
0 new messages