Prerequisites
Installation & Setup
API
Config File
Developer Mode
Developer Tools
Enable Debug Mode
Events
Extensions
Features
Integrations
License System Extension
Permissions
Updating FaxStore
Cache
Weblutions Documentation > FaxStore > Cache
Cache
From FaxStore V3 there is a built in cache which can be 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 the products cache updates.
Cached Content:
-
CACHE.customers
contains an array of customer data, not all database columns are reflected -
CACHE.reviews
contains an array of all reviews -
CACHE.products
contains an array of product data, not all database columns are reflected -
CACHE.settings
contains an object of all site settings from the database -
CACHE.categories
contains an array of all store categories -
CACHE.discord
contains an object if the Discord bot, this can be used to access channels, create commands and use the Discord integration
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