Ajax, not modified and cache

Ajax, not modified and cache

Hi

I have trouble using the cache capabilities when the server replied with a 304 status.
I use JQuery 2.1.3. I tested my code with Chrome 44 and Firefox 38.0.5. Same results with both browsers.

Here is my ajax call:
  1. $.ajax({
    method: "GET",
    url: "...",
    ifModified: true
    }).done(function (data, status, xhr) {
    console.log("data: " + data)
    console.log("status: " + status)
    console.log("response: " + xhr.responseText)
    })
The first call produces:
  1. "data: object"
  2. "status: success"
  3. "response: ..."
The second call produces:
  1. "data: undefined"
  2. "status: notmodified"
  3. "response: "
So the response is empty and the data is not usuable.
Is this the expected behavior ? With a 304 status, I would expect to have at least something in responseText.
If this is the expected behavior, what would be the proper way to support caching in my client ?

Thanks