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. Surprised how rapidly information spreads regarding reputable providers operating within community sector aimed specifically towards enhancing residential experiences provided largely thanks largely towards positive interactions established over time Shingle Roofers Tyngsboro

  2. Looking for diablo 4 builds boost? Dving.net and you will be able to order with a guarantee services for promotion and pumping in MMO games, as well as buy and sell in-game items in online games. Find out on the website which games we work with and check out our attractive prices. Reveal your full potential in your favorite pumping in MMO games, and we will help you reach new heights.

  3. The ideas shared in this post about managing intense dogs are valuable. Pet owners must be aware that addressing anger requires specialized training methods that are customized to each dog’s individual requirements Aggressive Dog Coaching

  4. I had an emergency with my HVAC system last week, and Summit Services came to the rescue! They’re truly the best in Hilton Head Island for ##HVAC service near me##. ac service