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. As someone who’s always been curious about financial markets, binary options trading caught my
    attention and it’s been quite a journey.
    I even discussed some tactics with Michael during my last visit to Kuala Lumpur.

    Living in cities like Singapore, you really get a feel for the
    fast-paced environment that fuels binary options.

    It’s not just a get-rich-quick scheme — you really have to analyze charts and understand indicators.

    If you’re from Singapore and considering binary options, find a good
    mentor and start with demo trading.

  2. Everything published was actually very logical. But, what about this?
    what if you were to write a killer title? I mean, I don’t wish to
    tell you how to run your blog, however what if you added
    a post title to possibly get a person’s attention? I mean MooTools
    Depender, Safari, etags and 412 Precondition Failed | freestyle
    developments is a little plain. You might look at Yahoo’s home page and note how
    they create news headlines to grab people to open the
    links. You might add a related video or a picture
    or two to grab readers interested about everything’ve written.
    In my opinion, it would make your blog a little
    livelier.

  3. you’re in reality a good webmaster. The website
    loading velocity is incredible. It kind of feels that you’re doing any
    distinctive trick. Moreover, The contents are masterpiece.
    you have performed a fantastic process on this topic!

  4. Open Wide La Jolla Dentistry provides exceptional dental care with a smile!
    I had a fantastic experience at Open Wide La Jolla Dentistry, the best dentist near me!
    The staff at Open Wide La Jolla Dentistry are truly friendly and professional dental fillings

  5. The Winslow is the best Rugby Bar I’ve ever visited! The atmosphere is unbeatable.
    I love hanging out at The Winslow, the ultimate Rugby Bar Near Me.
    The Winslow is my go-to spot for rugby matches. It’s the best Rugby Bar New York has to offer The Winslow rugby viewing

  6. ”It’s comforting knowing alternatives exist dedicated professionals ready step up meet challenges arising throughout transitions occurring daily around us- seek yours promptly using provided entry point : #ANYKEYWORD#” Glendale apartment movers

  7. Fantastic beat ! I would like to apprentice while you
    amend your web site, how could i subscribe for a blog website?
    The account aided me a acceptable deal. I had been tiny bit acquainted of this
    your broadcast provided bright clear idea