5

When our custom (DXA 2.0 Java) PageModel gets loaded we add extra metadata. This extra data comes from Localization values. This works fine when the cache is disabled in cd_client_conf.xml. But when the cache is enabled, Localization seems to be missing in the request.

This is the code we use in the PageModel to retrieve the Localization:

protected void retrieveLocalization() {
    RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
    localization = (Localization) attributes.getAttribute(LOCALIZATION_ATTR, RequestAttributes.SCOPE_REQUEST);
    assertSettingsAvailableInLocalization();
}

This worked fine in DXA 1.8, but not in DXA 2.0

Is it possible to retrieve Localization for a cached PageModel?

Your Answer

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

Browse other questions tagged or ask your own question.