1

I am leveraging items as resource files. While my app is running, if I try to update the *.dat file (the resource file) and then view one of the items in Content Editor, I do not see the expected field-level changes on the item.

Sitecore 10.2

Folder structure: \App_Data\items\master\myitemfile.dat

1 Answer 1

2

Items as resources rely on the CompositeDataProvider class which was added in 10.1. As this is a "data provider" it is subject to the same caching mechanisms as other data providers- specifically the prefetch cache.

Thus, if the application is running and you add a resource file that targets an item with the same ID that has previously been loaded by Sitecore (it's in the prefetch cache) then Sitecore does not think it needs to go back to the database (i.e. resource file in this case). So to fix the problem, after adding the new resource file, recycle the app. Alternatively, clear the cache via /sitecore/admin/Cache.aspx. CORRECTION: Only an app pool recycle correctly refreshes the items.

I go into more detail regarding the Sitecore item caching flow in my blog.

Surprisingly, Sitecore does not include the App_Data\items directory in its list of watchers. Adding this directory would also solve the problem.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.