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
Pathconfig.yml → cache
cache:
types:
ANIMATION:
invalidate_on_reload: true
duration: 1
time_unit: "MINUTES"
size: 10000
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
ICU_MESSAGE:
invalidate_on_reload: false
duration: 10
time_unit: "MINUTES"
size: 100000
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
PLAYTIME:
invalidate_on_reload: true
duration: 10
time_unit: "MINUTES"
size: 100
PLAYER_COLOR:
invalidate_on_reload: true
duration: 10
time_unit: "MINUTES"
size: 1000
PLAYER_SETTING:
invalidate_on_reload: true
duration: 10
time_unit: "MINUTES"
size: 1000
PLAYER_IGNORE:
invalidate_on_reload: true
duration: 1
time_unit: "HOURS"
size: 1000types
A list of all caches used in FlectonePulse. Each one has a specified lifetime, but it doesn't work like a "created and deleted after N seconds" timer. Instead, the time resets every time the cache is accessed. This means if a cache is constantly needed and frequently accessed, it will never be deleted, even if its lifetime is short.
| Type | Description |
|---|---|
COOLDOWN | For storing cooldowns given to players when using a module. For example, message cooldowns in chat or in the /me command. This is a storage location, not a cooldown enabler; each cooldown is enabled separately within the module |
ANIMATION | For storing animation frames of each player for the animation module |
DIALOG_CLICK | For tracking the number of clicks in custom dialogs, e.g., in /chatsetting. This allows closing the dialog for people who click in them too often, i.e., spam |
OFFLINE_PLAYERS | For storing offline players who have left the server but may return. It also stores nicknames that could be players, e.g., /tell Notch — obviously Notch is not on the server, but to find such a player FlectonePulse performs a series of operations and ultimately queries the database; if found, it saves with that data, otherwise it becomes an unknown player. On subsequent /tell Notch, it will be retrieved directly from cache, avoiding all checks |
MODERATION | For storing moderation results about players. Most often used to avoid querying the database every time a player joins the server |
ICU_MESSAGE | For storing string formatting results for the ICU (International Components for Unicode) integration |
LEGACY_COLOR_MESSAGE | For storing string formatting results containing legacy formatting, e.g., why replace &c with <red> every time if it can be taken from cache. This is necessary because each player gets their own formatted message, which are most often identical |
MENTION_MESSAGE | For storing message formatting results for the mention module. This is necessary because each player gets their own formatted message, which are most often identical |
SWEAR_MESSAGE | For storing message formatting results for the swear module. This is necessary because each player gets their own formatted message, which are most often identical |
REPLACEMENT_MESSAGE | For storing message formatting results for the replacement module. This is necessary because each player gets their own formatted message, which are most often identical |
REPLACEMENT_IMAGE | For storing formatted images for the replacement module |
TRANSLATE_MESSAGE | For storing messages that need to be translated |
PROFILE_PROPERTY | For storing player profiles with their skins, to avoid querying SkinsRestorer and creating them manually every time |
PLAYTIME | For storing player playtime results. Needed to avoid querying the database every time when calculating playtime |
PLAYER_COLOR | For storing each player's loaded colors from the database |
PLAYER_SETTING | For storing each player's loaded settings from the database |
PLAYER_IGNORE | For storing each player's loaded ignores from the database |
| Parameter | Explanation |
|---|---|
invalidate_on_reload | Will this cache be cleared on reload using /flectonepulse reload |
duration | The lifespan of an unused object in the cache, after which it will be deleted |
time_unit | The type of time unit for the unused cache object's lifespan |
size | The maximum size of the cache |
FlectonePulse