MooTools Depender, Safari, etags and 412 Precondition Failed

/**
* This replaces the default MooTools more Depender.request function to use
* HTTP "get" rather than "post".
*
* When sending requests for files via the depender, I was finding that Safari
* wasn't getting and re-evaluating them the second time I visited the page.
* This was because an etag was sent with each script.
*
* Safari responds to etags properly and adds "If-None-Match" and
* "If-Modified-Since" headers to another request for the same file. This makes
* Apache respond with a 412 status (Precondition Failed) as it should do for
* "post" requests (according to RFC 2616).
*
* Unfortunately Safari doesn't then deal with the 412 as it does with a 304
* (Not Modified). It doesn't grab what it has in the cache and put it in the
* response, it gives you nothing.
*
* For "get" requests, Apache has to respond with a 304, or 200 or whatever, but
* not 412. So we change the request method so we don't have to deal with 412.
*/
Depender.request = function(url, callback){
    new Request.JSON({
        url: url,
        secure: false,
        onSuccess: callback,
        method:'get'
    }).send();
};

24,935 thoughts on “MooTools Depender, Safari, etags and 412 Precondition Failed

  1. Lolzteam Market предлагает обширный выбор по заманчивой стоимости аккаунтов. Здесь вы найдете все, что вам надо. Каждый аккаунт тщательной проверке на подлинность подвергается. Ищете расценки аккаунтов warface? Izt.market/ – это портал для тех, кто по гарантии безопасности желает аккаунты купить. Здесь вы найдете различные категории, к примеру, такие: Instagram, Warface, Steam, Riot Games, Social Club, War Thunder, World of Tanks, Minecraft и множество других. Специалисты поддержки 24/7 работают. Они сделают все, чтобы вам помочь.

  2. I’ve been using The Brain Song for a few weeks now, and the results have been remarkable.

    This 17-minute daily audio session has helped me improve my memory recall, focus, and mental
    clarity. The soundwave technology stimulates the production of BDNF, a protein crucial
    for brain health. I appreciate that it’s a non-invasive, drug-free method to enhance cognitive function. It’s
    now a part of my daily routine, and I feel more mentally sharp and less stressed.

    globenewswire.com
    +6

  3. Amazing issues here. I am very satisfied to peer your post.

    Thanks a lot and I’m having a look ahead to touch you.

    Will you please drop me a e-mail?

  4. Loved your explanation surrounding periodontal disease symptoms — education empowers individuals towards prevention efforts ! Discover practical applications through connecting over  visit  at ### any Keyword### … Cosmetic Dentist