Caching allows you to temporarily store the return values of site web method calls and successful router calls on Wix's infrastructure. This provides quicker access to data and improves site performance. While caching is effective, it’s important to invalidate caches when necessary to ensure that your site's data always remains up to date. This helps preserve accuracy and prevents site visitors from seeing outdated content.
The Cache API provides functionality for invalidating site web method and router caches. Note that app web methods cannot cache their responses.
Consider invalidating your caches when there are significant changes to your site's content. For example, if a product on your e-commerce site becomes out of stock, you should invalidate the cache of the web method that retrieves and displays the product, ensuring that visitors see the most current status.
Learn more about caching.
It's important to note the following before you begin to code: