Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
This topic describes how to work with read-only object caching, and how this type of caching works behind the scene.
Most APIs in Episerver CMS return read-only instances of objects, such as DataFactory.GetPage which return a read-only PageData.
To make changes to read-only instances, create a writable clone with the CreateWritableClone method, which has the following advantages:
Classes that have the read-only support implements the IReadOnly<T> interface, which is defined as follows:
public interface IReadOnly
{
void MakeReadOnly();
bool IsReadOnly
{
get;
}
}
public interface IReadOnly<T> : IReadOnly
{
T CreateWritableClone();
}
The lifecycle of a typical PageData object is as follows:
Last updated: Sep 21, 2015