The GW2 MCP Server maintains an in-memory cache to reduce redundant calls to the Guild Wars 2 API. Each data category has a fixed time-to-live (TTL) after which the cached entry expires and the next request fetches fresh data from the API.

Cache TTL Values#

All TTL constants are defined in internal/cache/manager.go.

Static Game Data#

ConstantTTLApplies To
StaticDataTTL365 daysCurrency definitions
ItemDataTTL24 hoursItem metadata, skin metadata
RecipeDataTTL24 hoursRecipe details, recipe search results
AchievementDataTTL24 hoursAchievement details
ColorDataTTL24 hoursDye color definitions
MiniDataTTL24 hoursMiniature definitions
MountDataTTL24 hoursMount skin and type definitions (defined but not currently used in client)
DungeonDataTTL24 hoursDungeon and raid definitions (defined but not currently used in client)
WikiDataTTL24 hoursWiki search results, wiki page content

Account Data#

All account data keys include a SHA-256 hash of the API key for per-key isolation.

ConstantTTLApplies To
AccountDataTTL5 minutesAccount info, bank contents, material storage, shared inventory, character list, character details
WalletDataTTL5 minutesWallet balances
ProgressTTL5 minutesAccount progress (achievements, masteries, mastery points, luck, legendary armory, progression)
UnlocksTTL10 minutesAccount unlocks (skins, dyes, minis, titles, recipes, finishers, outfits, gliders, mail carriers, novelties, emotes, mounts, skiffs, jade bots)
DailiesTTL2 minutesCompleted dailies (daily crafting, dungeons, raids, map chests, world bosses)

Trading Post#

ConstantTTLApplies To
TPPriceTTL5 minutesItem buy/sell prices
TPListingTTL5 minutesItem order book listings
TPTransactionTTL5 minutesTransaction history (current buys, current sells, history buys, history sells)
TPExchangeTTL10 minutesGem-to-coin and coin-to-gem exchange rates
TPDeliveryTTL2 minutesTrading Post delivery box contents

Guild#

ConstantTTLApplies To
GuildInfoTTL1 hourPublic guild info (name, tag, level)
GuildSearchTTL1 hourGuild name search results
GuildDetailTTL5 minutesGuild detail data (log, members, ranks, stash, storage, treasury, teams, upgrades)

Wizard’s Vault#

ConstantTTLApplies To
WVSeasonTTL24 hoursCurrent season information
WVObjectivesAuthTTL5 minutesObjectives (authenticated, per-account)
WVObjectivesPublicTTL1 hourObjectives (public, unauthenticated)
WVListingsTTL1 hourReward listings (authenticated and public)

Game Metadata#

ConstantTTLApplies To
DailyAchievementTTL1 hourToday’s and tomorrow’s daily achievements
GameBuildTTL1 hourCurrent game build number
TokenInfoTTL10 minutesAPI key token info (name, permissions)

Cache Behavior#

  • Storage: In-memory only, using github.com/patrickmn/go-cache.
  • Persistence: The cache is not persisted to disk. All cached data is lost when the process exits.
  • Cleanup interval: Expired entries are purged every 10 minutes (CleanupInterval).
  • Default TTL: The underlying cache instance is created with StaticDataTTL (365 days) as the default expiration; individual entries override this with their specific TTL at write time.
  • Per-key isolation: Account-specific data (wallet, bank, materials, inventory, characters, unlocks, progress, dailies, trading post delivery, trading post transactions, Wizard’s Vault objectives, Wizard’s Vault listings, token info) is keyed by a SHA-256 hash of the API key. Different API keys produce separate cache entries.
  • Public data sharing: Non-authenticated data (items, skins, currencies, recipes, achievements, colors, minis, wiki content, guild info, game build, daily achievements, trading post prices, trading post listings, gem exchange rates) is shared across all users.

See Also#