Template:Item/purge

From Terraria Wiki
Jump to navigation Jump to search
Do NOT delete.
Do not delete this template page, even if it appears unused.
This template uses Lua.
This template uses Module:Item, a script written in the Lua programming language. To learn more about Lua, see Terraria Wiki:Lua.
Important.svg
CAUTION: Terraria Wiki code is complex!!!
If you want to use this code on another wiki, wiki.gg staff are not able to assist you.
Please consider picking a different wiki to adapt code from, or making your own templates!
Remember that content on a wiki is more important than fancy formatting.
Template-info.svg Documentation The documentation below is transcluded from Template:Item/purge/doc. (edit | history)

Template:Item caches its results to improve the performance of subsequent transclusions with identical parameters. This template purges the cache, which may be necessary in case there are issues.

Background

Take the transclusion {{item|Stone Block|Stone}} as an example. The template computes the output for this set of parameters and stores that output to the cache. When this very same transclusion occurs again later on the same page, the template does not have to compute the output fully anew again, because it already did so once before. It can simply retrieve the output from the cache.

The cache is cleared automatically after 24 hours but it can be cleared earlier via this template. This may be necessary if a cached output is erroneous.

Usage

Simply take the normal {{item}} transclusion that should be purged (e.g. {{item|Stone Block|Stone}}), change item to item/purge (e.g. {{item/purge|Stone Block|Stone}}), and temporarily save that wikitext on a sandbox page (just previewing is not sufficient). Make sure to include any relevant transclusions of {{options}} that affect the {{item}}.

This template does not produce any output and is only meant to be used temporarily. Do not transclude it permanently on any page.