Disable Caching per Session

To reduce the overhead of sending the documents over the network, client library is caching the HTTP responses and sends only ETags to Server.

If the request was previously cached giving the Server an opportunity to send back 304 Not Modified without any content data or sending the up-to-date results, this will update the cache.

This behavior can be changed globally by disabling the HTTP Cache size (more here), but can also be changed per session using the SessionOptions.NoCaching property.

Example

using (IDocumentSession Session = store.OpenSession(new SessionOptions
{
    NoCaching = true
}))
{
    // code here
}
using (IAsyncDocumentSession Session = store.OpenAsyncSession(new SessionOptions
{
    NoCaching = true
}))
{
    // async code here
}