Prerequisites
Installation & Setup
API
Cache
Config File
Developer Mode
Developer Tools
Enable Debug Mode
Events
Extensions
Features
Integrations
License System Extension
Permissions
Updating FaxStore
Weblutions Documentation > FaxStore > Cache
Cache
FaxStore offers a built in global cache which can accessed in any FaxStore file and is useful to developers and extension creators as data is cached and automatically refreshed. This can reduce non urgent queries and API calls that may not be needed.
FaxStore caches a range of items currently including; products, reviews, customers, settings, and more! By using the global variable CACHE the object can be referred to and used in a read only state. The cache automatically updates every hour, or on specific calls, like when a product is created, edited, or deleted the product cache is updated, same with other alike items.
FaxStore Cache is in versions 3.0.0 and above.
Cached Content:
-
CACHE.customerscontains an array of customer data, not all database columns are reflected -
CACHE.reviewscontains an array of all reviews -
CACHE.productscontains an array of product data, not all database columns are reflected -
CACHE.settingscontains an object of all site settings from the database -
CACHE.categoriescontains an array of all store categories -
CACHE.discordcontains an object if the Discord bot, this can be used to access channels, create commands and use the Discord integration -
CACHE.countscontains a count collection of many tables within the store, used for analytics
Basic usage
console.log(CACHE.customers) // will output an array of all customers
// Or to find a specific customer we could use
let customer = CACHE.customers.find(f => f.userId === "282762192544333827");
console.log(customer)
Related Articles
Review this page
faxstore cache fs cache
1 recommend this page