> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Control Page Caching Manually

## Article: Control Page Caching Manually

## Article Link: https://dev.wix.com/docs/develop-websites/articles/best-practices/caching/control-page-caching-manually.md

## Article Content:

# Control Page Caching Manually

Sometimes caching can cause site visitors to see outdated or incorrect content. For such cases you can manually control or disable caching for your site pages. 

You can manually control page caching by: 
- Disabling page caching in the editor.
- Setting a lifespan for page caches in the editor. 
- Using code to invalidate page caches when necessary.

## Disable caches or manage the cache lifespan in the editor

If the data on your site page changes very frequently, you can disable caching for that page, ensuring your site is always displaying the most up-to-date information. If the data on your page updates regularly, you can set your page's cache to clear and refresh at an interval that matches your needs.

To disable or manage caching: 

1. In the editor, click the **Pages** ![pages icon](https://wixmp-833713b177cebf373f611808.wixmp.com/images/200b9d74a1d550b51058678b2df28b0b.png) icon on the left sidebar to open the Site Pages panel. 

1. Click the **More Actions** ![show more](https://wixmp-833713b177cebf373f611808.wixmp.com/images/506abdf364c2f86a8f34670cbcac015b.png) icon for the page you want to control caching, and then select **Settings**. This opens the Page Settings panel for that page. 

1. Click **Advanced Settings** and turn on the **Manually control caching for this page** toggle. 

1. Open the **How often do you want to reset this page's cache?** dropdown. 
    - To disable caching for the page, select **Never (disable caching)**.
    - To manage the cache lifespan for the page, select the time interval that best suits your page's needs. 

<div style="text-align:center">
  
  <img src="https://wixmp-833713b177cebf373f611808.wixmp.com/images/1471d84b29ef2833a4736f59041f3d19.png" style="max-width:30vw" />

</div>


## Invalidate cache with code

If your page’s data only updates occasionally, you can keep automatic caching enabled and add code to the page to invalidate the cache when the page's data is expected to be updated. 

Call the [`invalidateCache()` method](https://dev.wix.com/docs/velo/apis/wix-site-backend/invalidate-cache.md) from the `wix-site-backend` module in your backend code.

```js
import { Permissions, webMethod } from "wix-web-module";
import wixSiteBackend from "wix-site-backend";

export const invalidateCache = webMethod(Permissions.Anyone, () => {
  return wixSiteBackend.invalidateCache();
});
```

<blockquote class="important">

__Important:__
The `invalidateCache()` method invalidates the cache for the whole site, not just the page where you run the code. 

</blockquote>


## See also 
- [About Caching](https://dev.wix.com/docs/develop-websites/articles/best-practices/caching/about-caching.md)
- [About Page Caching](https://dev.wix.com/docs/develop-websites/articles/best-practices/caching/about-page-caching.md)
- [Webinar: Planning for scale: large data design considerations](https://youtu.be/BGnpQ_LTHPg?feature=shared&t=1464)
- [wix-site-backend API](https://dev.wix.com/docs/velo/apis/wix-site-backend/introduction.md)