Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching breaks ContentService #2041

Closed
andyjwwhite opened this issue Jan 11, 2024 · 1 comment
Closed

Caching breaks ContentService #2041

andyjwwhite opened this issue Jan 11, 2024 · 1 comment

Comments

@andyjwwhite
Copy link
Contributor

Hi,

When caching is enabled, ContentService caches objects of different types under the same key. This means that once an object is cached, any further calls for the same ID that use a different type will always return null.

This means that using GenericContent objects is impossible with caching enabled. As soon as the list in the manager retrieves a list of ContentInfo objects, all your calls to retrieve the full objects start to fail (and vice versa).

// Get an instance of MyContent
var content = await api.Content.GetByIdAsync<MyContent>(ID);

// This call will now return null until cache is cleared
var contentInfo = await api.Content.GetByIdAsync<ContentInfo>(ID);
@tidyui tidyui closed this as completed in eecceed Apr 13, 2024
@tidyui tidyui assigned tidyui and unassigned tidyui Apr 13, 2024
@tidyui
Copy link
Member

tidyui commented Apr 13, 2024

Fixed by @cktricky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants