This document is published but is not in the cache after build
After doing a build all content is saying
This document is published but is not in the cache
We have to go to settings then settings / published status and reload memory cache.
We think issue is with one of our models builder extended models:
public DataDrivenProfile(IPublishedContent content) : base(content)
{
APIRequestConfig config;
var urlSegments = HttpContext.Current?.Request?.Url?.Segments;
if (urlSegments is null) return;
if (urlSegments.Length > 1 && urlSegments[1].Contains("umbraco"))
{
config = GetBackofficeConfig();
}
else
{
config = GetFrontEndConfig();
}
HydratePersonData(config);
}
basically we are hydrating parts of the model with data from graphapi and that is locked by okta authentication the config for okta depending on whether you are viewing frontend or backend is slightly different. During hydration we have to use Request object to determine what kind of request is being made.
I suspect during startup there is no Request and that is causing the nucache in memory to fail?
That cannot work. ContentModels are direct representation of content items, and in v8 they are not created per request but cached for much longer. Which means that you simply cannot capture anything request-bound in a content model.
Hydration of the model from locked down graph api, we need rendering for front end and backend.
However the authentication is different depending on whether you are viewing front end or backend so we need to be able to determine if request is front end or back end
This document is published but is not in the cache after build
After doing a build all content is saying
We have to go to settings then settings / published status and reload memory cache.
We think issue is with one of our models builder extended models:
basically we are hydrating parts of the model with data from graphapi and that is locked by okta authentication the config for okta depending on whether you are viewing frontend or backend is slightly different. During hydration we have to use Request object to determine what kind of request is being made.
I suspect during startup there is no Request and that is causing the nucache in memory to fail?
Anyone any ideas?
Regards
Ismail
That cannot work. ContentModels are direct representation of content items, and in v8 they are not created per request but cached for much longer. Which means that you simply cannot capture anything request-bound in a content model.
What are you trying to achieve?
Stephan,
Hydration of the model from locked down graph api, we need rendering for front end and backend.
However the authentication is different depending on whether you are viewing front end or backend so we need to be able to determine if request is front end or back end
Hi
can you move the code to a method and use in place of the property ?
e.g
then the in the code in the razor file would be
Model.PersonData()
and that would be fetched on the request ?This fixed the issue thanks kevin
Can some one help me to explain the fix of this issue "This document is published but is not in the cache" in Umbraco 8. As I am acing same. Thanks.
is working on a reply...