Expand my Community achievements bar.

SOLVED

Last modified time of a DAM resource

Avatar

Level 3

Hi,

when querying an image resource from AEM (e.g. /content/dam/blackrock/440px-AdamSmith.jpg) the value for Last-Modified header in the response does not match the jcr:lastModified timestamp value in the CRX. I would expect them to be the same, can you please help why they could differ?
I have attached the screenshots for both values.

Regards,
Peter

Screenshot 2024-06-27 at 17.09.15.pngScreenshot 2024-06-27 at 17.10.09.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @pnagy ,

Timestamp jcr:lastModified on AEM instance and  last-modified in browser network console can  be different because content  served to end user might be from 

  • CDN or
  • Dispatcher

which can be different based on last flushed cache or minute time taken in replication.

 

Thanks

View solution in original post

6 Replies

Avatar

Community Advisor

Hi @pnagy 
One of the reason could be that assets has different modify time on publisher or cached copy at dispatcher.

Could you please check timestamp at dispatcher?



Arun Patidar

Avatar

Level 3

Hi @arunpatidar ,

Thanks for all the replies. TBH not sure how I can check the dispatcher but that was an author instance I used for testing.
I have uploaded a new image on my local where I don't have any dispatcher / CDN, and the same behaviour (the difference in hours is just timezone difference but there is 18 sec difference yet).

Regards,
Peter

Screenshot 2024-06-28 at 11.01.29.pngScreenshot 2024-06-28 at 11.01.51.png

Avatar

Community Advisor

@pnagy I tried to verify on my instance for multiple assets, but I don't see this issue(the timestamp is same on both locations). 

I understand the curiosity piece of it but is there a specific use case you are trying to solve with Last Modified?

I'm curious to see what is the jcr:lastModified on the metadata node. Can you share.

Avatar

Level 3

Hi @gkalyan ,

I can't find lastModified timestamp on the metadata node (see attached).
The resource can be queried by page json url as well (e.g. embedded into a content fragment). The page json has the resource with the last modified timestamp from the JCR. There is a logic around the resource's last modified timestamp and we expect the timestamps to be equal no matter how they are queried.
So not sure where the dam jpg url takes the modified value from.

Screenshot 2024-07-01 at 12.05.15.png

Avatar

Community Advisor

@pnagy 

Dates in both locations seem to be same except for the format. ISO vs verbose/human readable.

 

The small difference in seconds might be due what @arunpatidar explained. The Last-Modified header is typically set by the Dispatcher cache, not directly from the JCR repository. If you are hitting the from Author instance, it should be the same.

 

Avatar

Correct answer by
Community Advisor

Hi @pnagy ,

Timestamp jcr:lastModified on AEM instance and  last-modified in browser network console can  be different because content  served to end user might be from 

  • CDN or
  • Dispatcher

which can be different based on last flushed cache or minute time taken in replication.

 

Thanks