AI Engine uses a cookie, mwai_session_id, to recognize each visitor’s session: it is needed for usage limits, uploaded files and statistics. Many caches stop serving cached pages to a visitor as soon as a cookie like this one is set.
The good news: AI Engine no longer sets this cookie when a page loads. For visitors who are not logged in, it is only set when they start using a chatbot or a form (through the /wp-json/mwai/v1/start_session request). So your pages stay cacheable for everyone who simply browses your site. Once a visitor has chatted, it is normal that your cache skips them: their session is personal. Logged-in users are usually not served from the cache anyway.
Disabling the Insights module does not change anything here: the cookie is set by the chatbot itself, not by Insights.
If you think a cookie is breaking your cache, this command fetches only the HTTP headers of a GET request to your website and filters out lines showing:
- Any cookie being set by the server.
- Any proxy cache information.
curl -sIXGET https://meowapps.com/ | grep -i 'proxy-cache\|cookie'
If the server sets a cookie on a simple page view (a set-cookie line), that response was probably not served from a cache. With an up-to-date AI Engine, you should not see mwai_session_id there. If you see another cookie, look for the plugin that sets it.
If you have a HIT header, it means the request was served from the cache instead of going all the way to the backend server.
Last thing: never cache AI Engine’s own requests. Exclude /wp-json/mwai/ and /wp-json/mwai-ui/ from your cache, as explained in Cookie Check Failure.