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. Hello are using WordPress for your site platform?

    I’m new to the blog world but I’m trying to get started and set up my own. Do you need
    any html coding expertise to make your own blog? Any help would be really
    appreciated!

  2. Моряки смогут изучить большое количество перспективных должностей, которые оплачиваются в соответствии с вашими потребностями, а потому удастся отыскать подходящую по зарплате, условиям деятельности должность. Сначала определитесь с должностью и типом флота. Можно найти работу на оффшорном, танкерном и других флотах. https://crewings.me – на портале вы найдете все необходимые контакты судовладельцев, а также крюингов. Для того чтобы найти то, что нужно, следует указать должность, а также тип флота. В базе всегда только актуальная, свежая информация.

  3. Hi this is kinda of off topic but I was wondering if
    blogs use WYSIWYG editors or if you have to manually code with
    HTML.I’m starting a blog soon but have no coding expertise so I wanted to get guidance from someone with experience.
    Any help would be greatly appreciated!

  4. whoah this blog is great i love reading your articles. Keep
    up the great work! You understand, lots of persons are
    searching around for this info, you can help them greatly.

  5. Hello, Neat post. There’s an issue with your web site in internet explorer, might check this?

    IE nonetheless is the market leader and a large component of people will omit your
    great writing due to this problem.

  6. Asking questions are in fact good thing if you are
    not understanding anything entirely, however this piece
    of writing offers nice understanding even.

  7. Hurrah, that’s what I was exploring for, what a data!

    existing here at this blog, thanks admin of this website.

  8. Earlier this morning, I woke up at around 3 AM, with my mind stuck
    on Kaiji. That show really gets under your skin.

    A fact I came across not long ago is that the creator used real behavioral tactics to make
    the gambling in Kaiji feel brutally authentic. It adds a whole new layer to the experience.

    I couldn’t go back to sleep, so I decided to read an article that explained the psychology
    behind the anime. Trust me, it’s worth checking out if Kaiji hooked you like it did me.

    Still riding the mental high, I logged into my favorite online casino and gave
    it a shot. I picked Gate of Olympus—no idea why.
    You’re not going to believe this—I hit a $1,000 win. Blew my mind.
    What I love about Gate of Olympus is the way multipliers can stack like crazy during free spins.

    I keep asking myself… was it random, or something more?
    Or did Kaiji awaken something?
    What do you think?.