boolean IPS_SetMediaCached (integer $MediaID, boolean $CacheActivated)
|MediaID||ID of the media object|
|CacheActivated||TRUE, if the media object should only be modified in the cache, otherwise FALSE|
|If the command succeeds, it returns TRUE, otherwise FALSE.|
The command activates or deactivates the caching for a media object with the ID MediaID. If activated, the media object is modified in the within the internal memory only when the functions IPS_SetMediaContent or IPS_GetMediaContent are used. When IP-Symcon shuts down, the media object is automatically stored in the physical memory and remains persistent.
This command can be used to decrease the burden to SSDs or flash memories.
$MediaID = IPS_CreateMedia(1); // Create image within the media pool IPS_SetMediaCached($MediaID, true); // Caching is activated for the media object // The object is read from the physical memory on the first access // Future accesses are done in the internal memory only.