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. Hi to all, as I am actually eager of reading this
    web site’s post to be updated on a regular basis.
    It contains fastidious data.

  2. I think that what you wrote was actually very reasonable. However, what about
    this? suppose you added a little content? I mean, I don’t wish to tell
    you how to run your website, however suppose you added a title to maybe grab folk’s attention? I mean MooTools Depender, Safari,
    etags and 412 Precondition Failed | freestyle developments is kinda plain. You ought to glance at Yahoo’s
    front page and note how they create news headlines to get
    viewers interested. You might add a related video or a pic or
    two to grab people interested about what you’ve written. Just my opinion, it might
    bring your blog a little livelier.

  3. It’s not my first time to pay a visit this website, i am
    visiting this website dailly and take nice facts from here
    every day.

  4. excellent publish, very informative. I’m wondering why the opposite experts of this sector
    don’t understand this. You should continue
    your writing. I’m confident, you’ve a great readers’ base already!

  5. интернет провайдер челябинск chelyabinsk-domashnij-internet002.ru домашний интернет тарифы челябинск

  6. I am not sure where you are getting your information, but great
    topic. I needs to spend some time learning much more or understanding more.
    Thanks for fantastic information I was looking for this info for my mission.

  7. excellent issues altogether, you just received a emblem new
    reader. What would you recommend in regards to your publish that you just made
    a few days ago? Any sure?

  8. Hi there I am so excited I found your webpage, I really found you by error, while I was looking
    on Digg for something else, Regardless I
    am here now and would just like to say thank you for a incredible post and a
    all round entertaining blog (I also love the theme/design), I don’t have
    time to look over it all at the moment but I have saved it and also
    added in your RSS feeds, so when I have time I will be back
    to read a great deal more, Please do keep
    up the excellent job.

  9. Greetings! This is my first visit to your blog! We are a collection of volunteers
    and starting a new project in a community in the same niche.
    Your blog provided us beneficial information to work on. You have done a marvellous
    job!

  10. Wow, this paragraph is fastidious, my sister is analyzing these
    kinds of things, therefore I am going to convey her.

  11. I’ve been using Reddit for a while, but getting
    visibility on a new account was always a challenge.
    After I bought a verified Reddit account, things completely changed.
    I avoided bans right away. If you want to get your Reddit marketing to the next level, I highly
    recommend starting with verified profiles.