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. What’s Going down i’m new to this, I stumbled
    upon this I’ve discovered It absolutely useful and it has aided
    me out loads. I hope to contribute & assist other customers
    like its helped me. Good job.

  2. Thank you for the auspicious writeup. It
    in fact was a amusement account it. Look advanced to far added agreeable from you!
    By the way, how can we communicate?

  3. Interesting blog! Is your theme custom made or did you download it
    from somewhere? A design like yours with a few simple adjustements would really make my blog jump out.
    Please let me know where you got your design. Thanks

    Feel free to visit my website zamorano01

  4. I have been exploring for a little for any high-quality articles or weblog posts in this kind of space .
    Exploring in Yahoo I at last stumbled upon this web site.
    Reading this information So i’m glad to show that I’ve a very excellent uncanny feeling I came upon just what I needed.
    I such a lot indubitably will make sure to do not overlook this web site
    and give it a look on a relentless basis.

  5. Hi i am kavin, its my first time to commenting anyplace, when i read this
    paragraph i thought i could also make comment due to this brilliant piece
    of writing.

  6. Hi it’s me, I am also visiting this site regularly, this web site is truly pleasant and the viewers are really sharing fastidious thoughts.

  7. Pretty section of content. I just stumbled upon your site and in accession capital to assert that I get in fact enjoyed account your blog posts.
    Anyway I will be subscribing to your feeds and even I achievement you access
    consistently rapidly.

  8. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
    You definitely know what youre talking about, why throw away your intelligence on just posting videos to your
    site when you could be giving us something enlightening
    to read?

  9. Because the admin of this site is working, no doubt very rapidly it will be
    well-known, due to its quality contents.

  10. I think this is among the most important info for me.
    And i’m glad reading your article. But want to remark on few general
    things, The web site style is great, the articles
    is really excellent : D. Good job, cheers

  11. I know this website provides quality dependent articles
    or reviews and additional material, is there any other
    site which offers such information in quality?

  12. Definitely believe that which you said. Your favorite
    reason seemed to be on the net the simplest thing to
    be aware of. I say to you, I definitely get irked while people think about worries that they just do not know about.
    You managed to hit the nail upon the top as well as
    defined out the whole thing without having side-effects , people
    can take a signal. Will likely be back to get more.
    Thanks

  13. Link exchange is nothing else except it is only placing the other person’s website link on your page
    at suitable place and other person will also do similar
    in support of you.

  14. May I just say what a comfort to uncover somebody who actually
    knows what they’re discussing over the internet.
    You actually realize how to bring an issue to light and make it important.

    More and more people ought to check this out and understand this
    side of the story. I was surprised that you aren’t more
    popular since you definitely possess the
    gift.

  15. Wonderful items from you, man. I have take note your stuff prior to and you’re just extremely great.
    I actually like what you’ve received here,
    really like what you are saying and the way wherein you say it.
    You’re making it entertaining and you still take care of to keep it
    wise. I can not wait to read much more from you.
    This is really a great web site.

  16. You actually make it seem so easy with your presentation but I find this topic
    to be really something which I think I would never understand.
    It seems too complex and very broad for me.
    I am looking forward for your next post, I will try to get the hang of it!