Flectone Logo FlectonePulse

Cache

Configuring cache size and time-to-live

Warning

DO NOT delete any of the caches, even if you think it will not be used; the cache must be created as an object.


⚙️ Setting

Path config.yml → cache
cache:
  types:
    COOLDOWN:
      invalidate_on_reload: false
      duration: 5
      time_unit: "HOURS"
      size: 5000
    DIALOG_CLICK:
      invalidate_on_reload: false
      duration: 1
      time_unit: "SECONDS"
      size: 100
    OFFLINE_PLAYERS:
      invalidate_on_reload: false
      duration: 1
      time_unit: "HOURS"
      size: 1000
    MODERATION:
      invalidate_on_reload: false
      duration: 1
      time_unit: "HOURS"
      size: 5000
    LEGACY_COLOR_MESSAGE:
      invalidate_on_reload: false
      duration: 10
      time_unit: "MINUTES"
      size: 100000
    MENTION_MESSAGE:
      invalidate_on_reload: false
      duration: 10
      time_unit: "MINUTES"
      size: 1000
    SWEAR_MESSAGE:
      invalidate_on_reload: false
      duration: 10
      time_unit: "MINUTES"
      size: 100000
    REPLACEMENT_MESSAGE:
      invalidate_on_reload: false
      duration: 10
      time_unit: "MINUTES"
      size: 100000
    REPLACEMENT_IMAGE:
      invalidate_on_reload: false
      duration: 10
      time_unit: "MINUTES"
      size: 100
    TRANSLATE_MESSAGE:
      invalidate_on_reload: false
      duration: 1
      time_unit: "HOURS"
      size: 5000
    PROFILE_PROPERTY:
      invalidate_on_reload: false
      duration: 1
      time_unit: "HOURS"
      size: 1000

types

A list of all caches used in FlectonePulse

TypeDescription
COOLDOWNFor storing delays issued to players when using a module. For example, chat message delays or delays in the /me command. This is a place for storage, not for enabling the delay; each delay is enabled within the module separately.
DIALOG_CLICKFor tracking the number of clicks in custom dialogs, such as /chatsetting. This allows closing the dialog for people who click in them too frequently, i.e., spamming.
OFFLINE_PLAYERSFor storing offline players who have left the server but might return. It also stores nicknames that could potentially be players, e.g., /tell Notch. Obviously, Notch is not on the server, but to find such a player, FlectonePulse uses a series of operations and ultimately queries the database. If found, they will be saved with this data; otherwise, they will be an unknown player. For subsequent /tell Notch calls, the data will be taken directly from the cache.
MODERATIONFor storing moderation results about players. Most commonly used to avoid querying the database every time a player joins the server.
LEGACY_COLOR_MESSAGEFor storing results of string formatting for strings containing legacy formatting. For example, why replace &c with <red> every time if it can be taken from the cache? This is necessary because a unique message is formatted for each player, and these messages are often identical.
MENTION_MESSAGEFor storing message formatting results for the mention module. This is necessary because a unique message is formatted for each player, and these messages are often identical.
SWEAR_MESSAGEFor storing message formatting results for the swear module. This is necessary because a unique message is formatted for each player, and these messages are often identical.
REPLACEMENT_MESSAGEFor storing message formatting results for the replacement module. This is necessary because a unique message is formatted for each player, and these messages are often identical.
REPLACEMENT_IMAGEFor storing formatted images for the replacement module.
TRANSLATE_MESSAGEFor storing messages that need to be translated.
PROFILE_PROPERTYFor storing player profiles along with their skins, to avoid contacting SkinsRestorer or creating them manually every time.
ParameterExplanation
invalidate_on_reloadWill this cache be cleared on reload using /flectonepulse reload
durationThe lifespan of an unused object in the cache, after which it will be deleted
time_unitThe type of time unit for the unused cache object's lifespan
sizeThe maximum size of the cache

Last updated on

Edit on GitHub

On this page

Authors of page