Documentation
IPS_SetMediaCached
boolean IPS_SetMediaCached (int $MediaID, boolean $CacheActivated)
Parameters
MediaID | ID of the media object |
CacheActivated | TRUE, if the media object should only be modified in the cache, otherwise FALSE |
Returns
If the command succeeds, it returns TRUE, otherwise FALSE.
Description
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.
Example
$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.