7

Our DXA 2.0 web app servers use Central European Time (CET) and access microservices hosted by SDL on servers using UTC/GMT. We have noticed that content and configuration was not always updated in the web application after republishing and (where necessary) admin/refresh.

If I access a binary file, DXA reads it from the content service and writes it to a file system cache. Subsequent attempts to read the binary file result in a check on the last published data metadata. If the time that the file was written is after the last published date, the binary is not updated.

The problem is that Tridion does not seem to provide the timezone with the last published date, and the CIL API assumes that it is thus in the timezone of the server running the web application.

We thus have a situation that if I access a binary at 09:00 CET, it is written to the filesystem with this timestamp. If I then republish at 09:15 CET to CD servers running on UTC, the microservices will tell me that the last published date is 08:15 (as this is the last modified date in UTC). The CIL then converts this to 08:15 CET, and when I access the binary subsequently, it sees thinks that the file is up to date (as the file creation time is later than the last published date). The only way to fix is to republish the binary after 10:00 CET (meaning the CIL thinks the last modified date is after 09:00 CET and thus rewrites the binary to the file system).

The standard answer to fix this would probably be why don't you set your server timezone to UTC, but this seems a bit lame to me. There may be many reasons to have your web application servers running in a local timezone, and Tridion should not force you to use UTC.

Is there instead some secret way to tell the CIL to use UTC instead of the local timezone when interpreting dates from the content service?

5

You can set -Duser.timezone=UTC in the JVM args when running your web application (on Tomcat or other) and this will fix the problem. Note that this may affect other date based functionality in your web application so be sure to test thoroughly that any part of the application that manipulates/displays dates is working correctly.

Note also that logging will now be in UTC, so you could add the timezone to the log message timestamp (the DXA default is without timezone) in logback.xml. See https://logback.qos.ch/manual/layouts.html for more information on how to do this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.