XDN cache miss issue

Seems that XDN adds cache-control: private, no-store, no-cache header to the html resources, it’s not being set in our code anywhere. In the same time, x-xdn-caching-status header is private.
Because of that, we have cache MISS every time on page access.
Is there any way to enable caching without using forcePrivateCaching: true?

@xdn/core": "2.24.1
@xdn/next": "2.24.1

Hi arturkin,

Sorry about the issues. Could you message me directly your site URL on moovweb.app and we will investigate.


1 Like

Also - fetches in some frameworks like Nuxt will pass through all the headers from the upstream so if your upstream is returning cache-control then it’s going to interfere with the caching.

Working with arturkin we have determined that the problem lies in the project code which wasn’t using our Next plugin. In our Next plugin there is this piece of code:

    // getServerSideProps adds cache-control: private by default, which prevents caching in the XDN.
    // If the user wants the responses to be truly private, they will need to add `cache({ browser: false })`
    // to their routes.
    updateUpstreamResponseHeader('cache-control', /(,\s*\bprivate\b\s*)|(^\s*private,\s*)/g, '');

After adding that bit to the router, the project is now correctly caching on XDN.

Thank you for working with us on this arturkin.