Cache Behavior

Various objects cache expensive to compute/fetch data (image, gif, skin_3d, head_3d, etc.) for better performance and reduced memory consumption. However, in cases where the data being cached is unique, local caching is a better solution. If the unique cached data (like per player images) accumulates in cache over time, it will result in high memory consumption.

Cache Behavior Modes

  • Global

    • Best option for static data, like image or gif files, or other data that is used commonly.

    • Only gets cleared when /ib reload is executed.

  • View

    • Best option for unique/dynamic data, that would not be reused after the player leaves.

    • Gets cleared together with the board view getting cleared. The exact behavior of this depends on the reset-radius-on-exit (General) setting. If reset-radius-on-exit is set to true, the cache will get cleared as soon as the player exits the radius of the board. If it is set to false, the cache will clear after the player leaves the server.

Every board object that stores data has the cache-behavior: setting.

## image1 is an example of a dynamically fetched image.
## Since the image is unique to each player in this example, it is important 
## that the image is cleared from cache after the player leaves the server.
image1:
  type: image
  size: 512 512
  ## the cache behavior setting (global, view)
  ## in this case set to view (global is the default)
  cache-behavior: view
  image:
    ## example image URL that is unique to each player
    name: 'https://example.com/statistics/%player_name%/summary-image.png'

Last updated