(Jump to code)Module Documentation[view] [edit] [latest diff] [hist] [purge]
Page Tools: Create Sandbox View subpages View links
Module Links: Create talk Latest Diff Page Logs
Page Protected from Editing
This page is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, it is subject to Page Protection.
This page is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, it is subject to Page Protection.
Page Actions: Unprotect • Change Protection • Protection log
Main page: Project:Lua § Caching
This is where information and functions about caches is stored. See Module:VarsCacheMap for using the cache class used on the wiki.
While these caches can be used to solve a few different issues, the main one this is used to solve is large lua memory usage (by only having to load the data when setting up the cache), and to a lesser extent lua time usage (since often these data files also loop through data).
Refreshing cache
Cache can be manually refresh via MediaWiki:Gadget-RefreshLuaCache.js.
This Module Requires Cache Refresh After Changes
Module Page Name(s): Module:Inventory slot/Datasheet
Prerequisite: Option RefreshLuaCache in your gadget settings must be enabled.
Instruction: If prerequisite is met, button(s) for refreshing cache entries will load below.
This Module Requires Cache Refresh After Changes
Module Page Name(s): Module:Item/Variants
Prerequisite: Option RefreshLuaCache in your gadget settings must be enabled.
Instruction: If prerequisite is met, button(s) for refreshing cache entries will load below.
This Module Requires Cache Refresh After Changes
Module Page Name(s): Module:Item/ApiData, Module:Item/ApiAliases
Prerequisite: Option RefreshLuaCache in your gadget settings must be enabled.
Instruction: If prerequisite is met, button(s) for refreshing cache entries will load below.
This Module Requires Cache Refresh After Changes
Module Page Name(s): Module:Crafting/Aliases
Prerequisite: Option RefreshLuaCache in your gadget settings must be enabled.
Instruction: If prerequisite is met, button(s) for refreshing cache entries will load below.
This Module Requires Cache Refresh After Changes
Module Page Name(s): Module:Minion/Data
Prerequisite: Option RefreshLuaCache in your gadget settings must be enabled.
Instruction: If prerequisite is met, button(s) for refreshing cache entries will load below.
Submodules
No submodules found for this page. Try purging the page or viewing all subpages.
See Also
- Extension:LuaCache - used for storing data in a site-wide cache
- Extension:VariablesLua - used for storing data in a page-wide cache
| Hypixel SkyBlock Wiki Standard Lua Libraries (hsw/stdll) v · d · e | |
| Type | Libraries |
|---|---|
| Module Loading Utilities |
|
| General Utilities |
|
| Meta Modules | |
| Object-oriented |
|
| Caching |
|
Module Code
local varsCacheMap = require('Module:VarsCacheMap')
local cacheUtil = require('Module:CacheUtil')
local p = {}
-- Inventory slot
local INVSLOT_1_PREFIX = 'invslot_02_'--don't index number unless cache has gone to complete hell; don't change this variable unless you know what you're doing please
p.invslotCache1 = varsCacheMap.create({ prefix=INVSLOT_1_PREFIX, dataModule='Inventory slot/Datasheet' })
local INVSLOT_2_PREFIX = 'invslot_03_'
p.invslotCache2 = varsCacheMap.create({ prefix=INVSLOT_2_PREFIX, dataModule='Inventory slot/Datasheet' })
local SLOT_ALIASES_PREFIX = 'slotaliases_04_'
p.slotAliasesCache = varsCacheMap.create({ prefix=SLOT_ALIASES_PREFIX, dataModule='Inventory slot/Aliases' })
-- Item Variants
local ITEM_VARIANTS_PREFIX = 'itemvariants_01_'
p.itemVariantsCache = varsCacheMap.create({ prefix=ITEM_VARIANTS_PREFIX, dataModule='Item/Variants' })
-- Item API data
local ITEM_API_DATA_PREFIX = 'itemapidata_01_'
p.itemApiDataCache = varsCacheMap.create({ prefix=ITEM_API_DATA_PREFIX, dataModule='Item/ApiData/AsCacheTable' })
-- Item API aliases
local ITEM_API_ALIASES_PREFIX = 'itemapialiases_01_'
p.itemApiAliasesCache = varsCacheMap.create({ prefix=ITEM_API_ALIASES_PREFIX, dataModule='Item/ApiAliases' })
-- Crafting aliases
local CRAFTING_ALIASES_PREFIX = 'craftingaliases_01_'
p.craftingAliasesCache = varsCacheMap.create({ prefix=CRAFTING_ALIASES_PREFIX, dataModule='Crafting/Aliases' })
-- Crafting aliases
local MINION_DATA_PREFIX = 'miniondata_01_'
p.minionDataCache = varsCacheMap.create({ prefix=MINION_DATA_PREFIX, dataModule='Minion/Data' })
--------------------------
-- Cache Refresh Helpers
--------------------------
-- called by tooltip editor
function p.refreshSlotAliasesCache()
p.slotAliasesCache:refreshCache()
end
-- Tooltips Cache Access, for Module:Inventory slot and Module:Collection/UI
function p.getInvslotCache(key, mode)
if (key == nil) then
return nil
end
if (cacheUtil.whichTooltipCache(key) == 1) then
return p.invslotCache1:get(key, mode)
else
return p.invslotCache2:get(key, mode)
end
end
return p