Chrome does not cache JSON responses

I write AJAX-based autocomplete and try to prevent my server from being flooded with requests using client-side caching. The configuration is as follows: Django serves JSON responses on the internal server, while the client uses the JQuery AJAX routines for the GETrelevant data.

request

Looking at the response headers in Chrome, everything looks good. The header is Cache-Controlpresent, so I'm sure the problem is outside the scope of Django.

response

However, server logs indicate that the API was requested.

logs

The code:

This is the code that I use to request the API.

function get(url, callback) {
    jQuery.ajax({
        type: 'GET',
        contentType: 'application/json',
        dataType: 'json',
        cache: true,
        url: url,
        success: callback
    });
}

Miscellaneous:

A small checkbox to disable cache is not checked, so Chrome should cache responses.

Edit:

. , 127.0.0.1:8000.

+4
1

Chrome Cache-Control:max-age=0 , F5.

- , , .

, : fooobar.com/questions/18134/...

+7

All Articles