About Page Caching

When a page on your site is requested for the first time, Wix caches the rendered page on a Content Delivery Network (CDN). The next time someone requests this page, Wix serves the cached version instead of rendering the page's elements and assets from scratch. Wix allows you to manage and disable caching for your site pages; however, the more pages on your site that are cached, the faster the overall experience is for your visitors.

Important: All pages on your site are cached automatically, except for those accessed by logged-in members. If a visitor is logged into your site, any page they open isn't cached and is always rendered from scratch. It's not possible to enable caching for logged-in member sessions.

Supported IDEs

You can manually control the lifespan of the cache and disable caching in:

  • The editor (Wix Studio and Wix Editor).

You can invalidate your caches manually using code in:

  • The editor (Wix Studio and Wix Editor)
  • The Wix IDE
  • Your local IDE

Cache invalidation

By default, page caches are cleared or invalidated after 1 week. Additionally, page caches are automatically invalidated whenever you publish your site or when application data changes. For example, if you update the product catalog in the Stores app, the page cache is cleared, and the page is then re-cached the next time a site visitor requests the page.

In situations where your page's data is updated infrequently, such as when your code fetches data from an external collection, you can invalidate the cache using the wix-site-backend API. This ensures that visitors don't see outdated information on your site.

When to control or disable caching manually

Wix allows you to manage caching for your site pages. This means that you can determine how often to refresh page caches or disable caching for a page entirely.

When managing page caching, it's important to consider how pages may appear differently to various site visitors. You should consider manually controlling page caching for:

  • Pages that retrieve data from external sources, such as product availability from an inventory management system.
  • Pages that display frequently changing data, like exchange rates or stock market details.
  • Pages that customize the display of elements based on a site visitor's geo-location, such as currency or time zone.
  • Pages that automatically update the date or time on a page to reflect real-time changes.

These types of pages require Wix's servers to render the changes to provide the most current information. If automatic caching is enabled, visitors might initially see outdated content because the page is served from a cached version, rather than being freshly generated. For example, if the code on your page fetches exchange rates from an external resource and displays them in a TextBox element, visitors may see outdated rates from the cached version before the new rates are fetched and rendered. This can cause a temporary "flicker" effect as the page data updates.

If your page's content only updates occasionally, you can keep caching enabled and invalidate the cache in your code whenever the data is updated. Properly controlling caching is essential for delivering accurate information and ensuring a smooth experience for your site visitors.

Note: Code added to your site's masterPage.js file runs on every page of your site. This code can affect how each page is displayed and may cause incorrect content to be shown if a page is cached. If you need to We recommend checking your masterPage.js file and only including code that must run on every page. Move other code to the appropriate page files.

See also

Did this help?