JQuery (or perhaps a browser) are cache ajax scripts

I am loading a view page through a call $.ajax()using jQuery. I explicitly set the cache parameter to true. Nowhere in the application do we use $.ajaxSetup()to indicate otherwise.

Here's the ajax request setup:

$(".viewDialogLink").click(function() {
    $.ajax({
        url: $(this).attr("href"),
        dataType: "html",
        type: "GET",
        cache: true,
        success: function(data) { $("#dlgViews").html(data).dialog("open"); }
    });
    return false;
});

The response is returned successfully. A dialog box opens and some content appears.

HOWEVER

There are script tags in the returned html. For instance:

<script type="text/javascript" src="http://../jsapi/arcgis/?v=1.4"></script>

Now - in the response text they look normal. But the actual browser requests for these scenarios, as seen from FireBug, include a caching option in the query string. They look like this:

http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.4&_=1264703589546.

None of the other resources of the downloaded html-css or images include a cache break in their request.

What's happening? How to disable this sleep timer?

+3
1

. jQuery 1.3.2 1.4.1. JQuery 1.4.1 -.

 <script type="text/javascript" src="jquery-1.4.1.min.js"></script>

, 1.4.1 .

+3

Source: https://habr.com/ru/post/1730437/


All Articles