# How to configure the cache for manipulated images

You can manipulate output images by using the edit parameter in URL query (see API for /modules/<module>/objects/<id>/media/<type>).

If modifying an image is taking too long, it makes sense to use the cache for it.

To do this, you must set following parameters in the target download profile:

  • cache_control to on_demand_do_cache;
  • cache_eviction to the integer value greater than 0 that indicates how long in days the cache will hold. If the value is 0 or negative, the cache will be disabled and all files that have already been cached will be deleted.

Optional you can also set the parameter cache_max_count to the integer value greater than 0 that indicates how many cache files of the same type will hold. Default value is 10.

All cache files stored under the path cefs/<module>/object_image/cache/.../<id>/<profile>....

# Cache cleanup

The cache checked for cleaning up once a day at midnight. To change it you can add the start parameter --ois.cache.cleanup or set the environment variable OIS_CACHE_CLEANUP to the crontab value in form of <second> <minute> <hour> <day of month> <month> <day(s) of week> (e.g. "0 0 0 * * *" for 0:00 every day).

# Example

<setup>
   ...
  <cache_control>on_demand_do_cache</cache_control>
  <cache_eviction>1</cache_eviction> // hold cache for one day
  <cache_max_count>25</cache_max_count>
   ...
</setup>
Request missing documentation