The caching mechanism of AJAX is the same as the caching mechanism for browsers when processing resources.
Three Simple rules:
As long as the URL is the same GET request, the browser uses the cache (and of course the server's Cache-control/expires/last-modified/etag header settings).
The browser is not cached as long as it is a POST request.
HTTPS request, the browser will not cache (most of the case, but there are exceptions, it is said that the FF browser is the exception).
Add:
Spelling a random query string in a URL allows the browser to think that this is a new request, thereby eliminating the use of caching.
Set HTTP headers in AJAX requests: if-modified-since:0, tell the server to ask for new content.
Supplementary Note:
In general, the user manually triggers the browser refresh (Windows:f5 macos:command+r), the browser ignores the resource's cache-control/expires header settings and goes to the server. This is true for both page refreshes and Ajax refreshes. But I've heard that IE doesn't follow this rule. I don't know if it's the same for all versions of IE browsers. If any heroes know this, do not hesitate to enlighten.