While testing and investigating/debugging DXA’s distributed (Redis) caching to see how it works, I ran into some issues. The caching code (storing and retrieving) works fine for the plain PageModel, most of the time (except when it has includes), but never for a custom one. The (custom) Page Model gets successfully stored in Redis, but it’s never retrieved, even though the key and the cache regions match. The code always returns null. And not just that, output caching also doesn’t work, neither for entities, nor pages. Again, the values are stored, but are not retrieved.

During the investigation I have reached the lowest point of the caching which is part of the DXA framework and I saw nothing wrong. After that point, the code calls into the Get method from the Sdl.Web.Delivery.Caching which returns null. I suspect there is an issue with deserialization.

enter image description here

I have put together the following table with my test cases:

enter image description here

Screenshot of what is stored in Redis. One more thing to point is that the publication mappings for example are in a readable form, while this (Page Model) data looks like gibberish (actually like hexa, but with various symbols mixed inside):

enter image description here

The snippet of the code and what is returned when Get is called:

enter image description here

The environment is set in the following way:

  • Tridion 9.0

  • DXA 2.2 .NET

  • Redis 3.2.100

  • DefaultCacheProvider is used in the solution.

  • Sdl.Web.Delivery package 11.0.1062

enter image description here

This seems like a defect in the SDL.Web.Delivery dll(s), but I want to check just in case, did anyone else experience any issues with Redis cache?

I will also contact SDL support as the problematic method is within a closed library, and if I get a response, I will update the question accordingly.

  • Did you annotate your custom Page Model as [Serializable]? May 13, 2020 at 17:23
  • Yes, tried that as well. May 14, 2020 at 7:10
  • Before we go deeper into the custom page model discussion or troubleshooting, let's take a step back and put that subject aside for now. I say this because we observe the same behavior for Page and Entity output caching (with the default page model!) as well. I think that's a much simpler scenario to look at, reproduce and debug. And, most probably it has the same root cause, so fixing the output caching should also fix the model caching and other scenarios stated in the table. May 14, 2020 at 12:35
  • Hi @MilicaStankovic is there any chance you figured out what is the issue? I am experiencing the same with DXA 2.2 and Tridion 9.5
    – copoet
    Jan 12 at 7:04


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.